projects
/
project
/
iwinfo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e8a1e7d
)
utils: fix segfault in iwinfo_hardware_id_from_mtd()
author
Jo-Philipp Wich
<jow@openwrt.org>
Mon, 1 Jun 2015 04:23:14 +0000
(06:23 +0200)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Mon, 1 Jun 2015 04:23:14 +0000
(06:23 +0200)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
iwinfo_utils.c
patch
|
blob
|
history
diff --git
a/iwinfo_utils.c
b/iwinfo_utils.c
index f4b7b586c65e8417e01ffe60b2535b45a2086504..3b993d124884a061fe8444ac8a871491e03bb379 100644
(file)
--- a/
iwinfo_utils.c
+++ b/
iwinfo_utils.c
@@
-177,8
+177,8
@@
int iwinfo_hardware_id_from_mtd(struct iwinfo_hardware_id *id)
FILE *mtd;
uint16_t *bc;
- int fd;
- unsigned int len
, off
;
+ int fd
, off
;
+ unsigned int len;
char buf[128];
if (!(mtd = fopen("/proc/mtd", "r")))
@@
-186,7
+186,7
@@
int iwinfo_hardware_id_from_mtd(struct iwinfo_hardware_id *id)
while (fgets(buf, sizeof(buf), mtd) != NULL)
{
- if (fscanf(mtd, "mtd%
u
: %x %*x %127s", &off, &len, buf) < 3 ||
+ if (fscanf(mtd, "mtd%
d
: %x %*x %127s", &off, &len, buf) < 3 ||
(strcmp(buf, "\"boardconfig\"") && strcmp(buf, "\"EEPROM\"") &&
strcmp(buf, "\"factory\"")))
{