diff options
author | Martin Mares <mj@ucw.cz> | 2009-01-30 14:05:13 +0100 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2009-01-30 14:05:13 +0100 |
commit | f6476d659b07d034bace15498bc2c8a95d413c2b (patch) | |
tree | 8e294cc1b21783415f402baf74b20ad114276a5e | |
parent | e1a54852e2db085a6bf36f873f2660e428074a5c (diff) | |
download | pciutils-f6476d659b07d034bace15498bc2c8a95d413c2b.tar.gz |
setpci: Fixed a typo in parsing of values, causing SIGSEGV on some bad inputs.
Patch by Andreas Wiese.
-rw-r--r-- | setpci.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -630,13 +630,13 @@ static void parse_op(char *c, struct pci_dev **selected_devices) 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); |