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>
This commit is contained in:
Philip Withnall
2017-08-15 12:04:45 +01:00
parent d18f026ee7
commit 1893c1ff74

View File

@@ -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)