From: Jens Steinhauser Date: Fri, 17 Apr 2015 21:28:44 +0000 (+0200) Subject: Check if hash table is NULL before accessing it. X-Git-Tag: sigrok-cli-0.6.0~30 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=bc5b66d7044337c00a6c2a8af86b910d33a56a90;p=sigrok-cli.git Check if hash table is NULL before accessing it. This fixes bug 520. --- diff --git a/parsers.c b/parsers.c index d788532..333e6e4 100644 --- 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"));