summaryrefslogtreecommitdiff
blob: f7aee8a63afb99329e580a01b334a166cdc6efb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
http://bugs.gentoo.org/256464

if "f" is NULL, dont try to deref it

patch by Andreas Wiese

--- a/setpci.c
+++ b/setpci.c
@@ -630,13 +630,13 @@
       e = strchr(value, ',');
       if (e)
 	*e++ = 0;
-      if (parse_x32(value, &f, &ll) < 0 || *f && *f != ':')
+      if (parse_x32(value, &f, &ll) < 0 || f && *f != ':')
 	parse_err("Invalid value \"%s\"", value);
       lim = max_values[op->width];
       if (ll > lim && ll < ~0UL - lim)
 	parse_err("Value \"%s\" is out of range", value);
       op->values[j].value = ll;
-      if (*f == ':')
+      if (f && *f == ':')
 	{
 	  if (parse_x32(f+1, NULL, &ll) <= 0)
 	    parse_err("Invalid mask \"%s\"", f+1);