iwinfo: fix crash on parsing mtd (#15807)
[openwrt.git] / package / network / utils / iwinfo / src / iwinfo_utils.c
index 1a831f3..dd49303 100644 (file)
@@ -182,7 +182,7 @@ int iwinfo_hardware_id_from_mtd(struct iwinfo_hardware_id *id)
 
        while (fgets(buf, sizeof(buf), mtd) > 0)
        {
-               if (fscanf(mtd, "mtd%d: %*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\"")))
                {