summaryrefslogtreecommitdiff
path: root/glnx-console.c
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2017-08-15 12:04:45 +0100
committerPhilip Withnall <withnall@endlessm.com>2017-08-15 17:37:47 +0100
commit1893c1ff748ee39f33e7eef1c833ce47897ff95d (patch)
tree16bf1939be8f3f2ddc0293736d427dbf008ade1b /glnx-console.c
parentd18f026ee7316bc2dde291c55db49b69dcb76df3 (diff)
downloadlibglnx-1893c1ff748ee39f33e7eef1c833ce47897ff95d.tar.gz
glnx-console: Add missing NULL check before writing out text
It’s possible that text is NULL on this path. Coverity CID: 1376570 Signed-off-by: Philip Withnall <withnall@endlessm.com>
Diffstat (limited to 'glnx-console.c')
-rw-r--r--glnx-console.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/glnx-console.c b/glnx-console.c
index cf5409c..785f348 100644
--- a/glnx-console.c
+++ b/glnx-console.c
@@ -222,7 +222,8 @@ text_percent_internal (const char *text,
if (percentage == -1)
{
- fwrite (text, 1, input_textlen, stdout);
+ if (text != NULL)
+ fwrite (text, 1, input_textlen, stdout);
/* Overwrite remaining space, if any */
if (ncolumns > input_textlen)