filter_parser: validate return value when expanding map
@@ -222,6 +222,12 @@ static int cb_parser_filter(void *data, size_t bytes,
ret = flb_msgpack_expand_map(out_buf, out_size,
append_arr, append_arr_len,
&new_buf, &new_size);
+ if (ret == -1) {
+ flb_error("[filter_parser] cannot expand map");
+ msgpack_unpacked_destroy(&result);
+ return FLB_FILTER_NOTOUCH;
+ }
+
flb_free(out_buf);
out_buf = new_buf;
out_size = new_size;
