When both ret_data and ret_size are NULL after decompress_startswith()
has confirmed the field matches, skip the decompress_blob() call.
This avoids decompressing potentially large payloads (e.g. inline
coredumps) just to discard the result.
Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
*ret_size = 0;
return 0;
}
+
+ /* Caller only wants to check field existence, skip full decompression */
+ if (!ret_data && !ret_size)
+ return 1;
}
r = decompress_blob(compression, payload, size, &f->compress_buffer, &rsize, 0);