]> sigrok.org Git - sigrok-cli.git/commitdiff
Check if hash table is NULL before accessing it.
authorJens Steinhauser <redacted>
Fri, 17 Apr 2015 21:28:44 +0000 (23:28 +0200)
committerBert Vermeulen <redacted>
Fri, 17 Apr 2015 22:22:13 +0000 (00:22 +0200)
This fixes bug 520.

parsers.c

index d788532f17097915511383851066141a999b7007..333e6e49053e24c0555e2443d75b9a748ca4b63d 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -408,6 +408,9 @@ int parse_driver(char *arg, struct sr_dev_driver **driver, GSList **drvopts)
        int i;
        char *drvname;
 
+       if (!arg)
+               return FALSE;
+
        drvargs = parse_generic_arg(arg, TRUE);
 
        drvname = g_strdup(g_hash_table_lookup(drvargs, "sigrok_key"));