libsysprof: don't try to compress 0 length file content

This commit is contained in:
Christian Hergert
2023-07-19 18:32:45 -07:00
parent 3b2e9edeb9
commit 4d37230917

View File

@ -756,6 +756,9 @@ _sysprof_recording_add_file_data (SysprofRecording *self,
if (length < 0)
length = strlen (contents);
if (length == 0)
compress = FALSE;
if (compress)
{
compress_bytes = do_compress (contents, length, &compress_len);