X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubox.git;a=blobdiff_plain;f=kmodloader.c;h=c780379ed47f4349a2bc0c96d3bd9481943ea79f;hp=065ac82cccbc4a96fa5a744a42ff95de8c9c0d78;hb=9371411715c8dd882f1d65a712f1f38b6d38d01f;hpb=a62c946ecdced9468ad16738325ee322029b0476 diff --git a/kmodloader.c b/kmodloader.c index 065ac82..c780379 100644 --- a/kmodloader.c +++ b/kmodloader.c @@ -302,12 +302,14 @@ static struct module* get_module_info(const char *module, const char *name) } strings = map + offset; - while (strings && (strings < map + offset + size)) { + while (true) { char *sep; int len; while (!strings[0]) strings++; + if (strings >= map + offset + size) + break; sep = strstr(strings, "="); if (!sep) break; @@ -410,12 +412,14 @@ static int print_modinfo(char *module) strings = map + offset; printf("module:\t\t%s\n", module); - while (strings && (strings < map + offset + size)) { + while (true) { char *dup = NULL; char *sep; while (!strings[0]) strings++; + if (strings >= map + offset + size) + break; sep = strstr(strings, "="); if (!sep) break;