[PATCH] parse_options's fails prematurely on parsing options

From: Robert M.Love (rml@tech9.net)
Date: Tue Jul 25 2000 - 12:18:25 EST


/init/main.c's parse_options aborts the parse loop (via break) when
either the max size of the environment variable array OR the max size of
the arguments to init array is reached. however, there may be more of
the other (ie max envp_init is hit, but not max argv_init) or there may
be more kernel options to parse. the sizes are unrelated.

by changing the breaks to continues, we can continue to parse
everything, and still be safe (we just hit the if checks again).

tested and patched against 2.40-test5-pre4, but this should work as far
back as at least 2.2.0. patch attached, thanks.

-- 
Robert M. Love
rml@tech9.net
rml@ufl.edu

--- v2.4.0-test5/init/main.c Tue Jul 25 12:54:22 2000 +++ linux/init/main.c Thu Jul 13 19:02:33 2000 @@ -457,11 +457,11 @@ */ if (strchr(line,'=')) { if (envs >= MAX_INIT_ENVS) - break; + continue; envp_init[++envs] = line; } else { if (args >= MAX_INIT_ARGS) - break; + continue; if(*line) argv_init[++args] = line; }

--- v2.4.0-test5/CREDITS Tue Jul 25 12:56:36 2000 +++ linux/CREDITS Sun Jul 23 11:10:45 2000 @@ -1556,6 +1556,12 @@ S: Niwot, Colorado 80503 S: USA +N: Robert M. Love +E: rml@tech9.net +E: rml@ufl.edu +D: misc. kernel hacking, debugging, and enjoying +S: FL, USA + N: Martin von Löwis E: loewis@informatik.hu-berlin.de D: script binary format

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:19 EST