]> xenbits.xensource.com Git - xen.git/commitdiff
xen: Fix off-by-one error when parsing command line arguments
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 3 Jul 2012 12:51:14 +0000 (13:51 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 3 Jul 2012 12:51:14 +0000 (13:51 +0100)
As Xen currently stands, it will attempt to interpret the first few
bytes of the initcall section as a struct kernel_param.

The reason that this not caused problems is because in the overflow
case, param->name is actually a function pointer to the first
initcall, and intepreting it as string is very unlikely to match an
ASCII command line parameter name.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25587:2cffb7bf6e57
xen-unstable date:        Tue Jul 03 13:38:19 2012 +0100

xen/common/kernel.c

index f45fb9ab36eec86d7f7ee41424029642cc572e16..d85d4d9b737341958a6801c3b7164161825c63c7 100644 (file)
@@ -68,7 +68,7 @@ void cmdline_parse(char *cmdline)
         if ( !bool_assert )
             optkey += 3;
 
-        for ( param = &__setup_start; param <= &__setup_end; param++ )
+        for ( param = &__setup_start; param < &__setup_end; param++ )
         {
             if ( strcmp(param->name, optkey) )
                 continue;