Skip to content
Snippets Groups Projects
Commit 29ad99c9 authored by Colin Walters's avatar Colin Walters
Browse files

console: Fix Coverity NULL deref warning

We need to handle our "empty to NULL canonicalization" before
doing the length.

Coverity CID: 1376570
parent a46752ed
No related branches found
No related tags found
No related merge requests found
......@@ -187,11 +187,12 @@ text_percent_internal (const char *text,
const guint n_spaces = sizeof (spaces) - 1;
const guint ncolumns = glnx_console_columns ();
const guint bar_min = 10;
const guint input_textlen = text ? strlen (text) : 0;
if (text && !*text)
text = NULL;
const guint input_textlen = text ? strlen (text) : 0;
if (percentage == current_percent
&& g_strcmp0 (text, current_text) == 0)
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment