1 |
vapier 09/01/29 18:57:17 |
2 |
|
3 |
Added: pciutils-3.1.0-null-ptr.patch |
4 |
Log: |
5 |
Add fix by Andreas Wiese for NULL ptr deref #256464. |
6 |
(Portage version: 2.2_rc23/cvs/Linux x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 sys-apps/pciutils/files/pciutils-3.1.0-null-ptr.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/pciutils/files/pciutils-3.1.0-null-ptr.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/pciutils/files/pciutils-3.1.0-null-ptr.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: pciutils-3.1.0-null-ptr.patch |
15 |
=================================================================== |
16 |
http://bugs.gentoo.org/256464 |
17 |
|
18 |
if "f" is NULL, dont try to deref it |
19 |
|
20 |
patch by Andreas Wiese |
21 |
|
22 |
--- a/setpci.c |
23 |
+++ b/setpci.c |
24 |
@@ -630,13 +630,13 @@ |
25 |
e = strchr(value, ','); |
26 |
if (e) |
27 |
*e++ = 0; |
28 |
- if (parse_x32(value, &f, &ll) < 0 || *f && *f != ':') |
29 |
+ if (parse_x32(value, &f, &ll) < 0 || f && *f != ':') |
30 |
parse_err("Invalid value \"%s\"", value); |
31 |
lim = max_values[op->width]; |
32 |
if (ll > lim && ll < ~0UL - lim) |
33 |
parse_err("Value \"%s\" is out of range", value); |
34 |
op->values[j].value = ll; |
35 |
- if (*f == ':') |
36 |
+ if (f && *f == ':') |
37 |
{ |
38 |
if (parse_x32(f+1, NULL, &ll) <= 0) |
39 |
parse_err("Invalid mask \"%s\"", f+1); |