[tracker-miners/wip/carlosg/coverity-fixes: 1/11] tracker-extract: Initialize variable properly
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/coverity-fixes: 1/11] tracker-extract: Initialize variable properly
- Date: Mon, 14 Sep 2020 10:33:07 +0000 (UTC)
commit b620bfeb119fcb9f90a41bd9767c92a868c4194d
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Sep 7 18:30:41 2020 +0200
tracker-extract: Initialize variable properly
The GString goes uninitialized in the (unused) helper function reading
from streams. Spotted by Coverity.
CID: #354745, #354743
src/tracker-extract/tracker-read.c | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/src/tracker-extract/tracker-read.c b/src/tracker-extract/tracker-read.c
index da8540bfa..21fc1656f 100644
--- a/src/tracker-extract/tracker-read.c
+++ b/src/tracker-extract/tracker-read.c
@@ -290,6 +290,9 @@ tracker_read_text_from_stream (GInputStream *stream,
break;
}
+ if (!s)
+ s = g_string_new (NULL);
+
/* Process read bytes, and halt loop if needed */
if (!process_chunk (buf,
n_bytes_read,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]