From 4d37230917542b9cfee6641b5deed685ce51bb37 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 19 Jul 2023 18:32:45 -0700 Subject: [PATCH] libsysprof: don't try to compress 0 length file content --- src/libsysprof/sysprof-recording.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libsysprof/sysprof-recording.c b/src/libsysprof/sysprof-recording.c index 590a8d67..36c882a9 100644 --- a/src/libsysprof/sysprof-recording.c +++ b/src/libsysprof/sysprof-recording.c @@ -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);