summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2018-07-24 12:45:42 +0200
committerDavid King <amigadave@amigadave.com>2019-01-21 14:38:59 +0000
commit538e86cc7c1c529f838a3aa5c1f603b37a5ad8cb (patch)
treede10b9a15de2fa93e576eb41847d979270652665
parent9847b4320718f5a2f0f61b4142268d6f3e273f6f (diff)
downloadyelp-538e86cc7c1c529f838a3aa5c1f603b37a5ad8cb.tar.gz
Check variable before dereferencing it
yelp-3.28.1/libyelp/yelp-mallard-document.c:341: var_compare_op: Comparing "path" to null implies that "path" might be null. yelp-3.28.1/libyelp/yelp-mallard-document.c:346: var_deref_op: Dereferencing null pointer "path".
-rw-r--r--libyelp/yelp-mallard-document.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libyelp/yelp-mallard-document.c b/libyelp/yelp-mallard-document.c
index 1302a116..b1565580 100644
--- a/libyelp/yelp-mallard-document.c
+++ b/libyelp/yelp-mallard-document.c
@@ -346,7 +346,7 @@ mallard_think (YelpMallardDocument *mallard)
*/
error = g_error_new (YELP_ERROR, YELP_ERROR_NOT_FOUND,
_("The directory ā€˜%sā€™ does not exist."),
- path[0]);
+ path && path[0] ? path[0] : "NULL");
yelp_document_error_pending ((YelpDocument *) mallard, error);
g_error_free (error);
goto done;