diff options
Diffstat (limited to 'sys-apps/pciutils/files/pciutils-3.1.0-null-ptr.patch')
-rw-r--r-- | sys-apps/pciutils/files/pciutils-3.1.0-null-ptr.patch | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys-apps/pciutils/files/pciutils-3.1.0-null-ptr.patch b/sys-apps/pciutils/files/pciutils-3.1.0-null-ptr.patch new file mode 100644 index 000000000000..f7aee8a63afb --- /dev/null +++ b/sys-apps/pciutils/files/pciutils-3.1.0-null-ptr.patch @@ -0,0 +1,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); |