[syslinux] bug in com32/modules/chain.c

Geert Stappers stappers at stappers.nl
Thu May 21 04:04:33 PDT 2009


Op 20090513 om 09:38 schreef H. Peter Anvin:
> Luciano Miguel Ferreira Rocha wrote:
> > Hello,
> > 
> > The main function in com32/modules/chain.c does a lot of argument
> > parsing, finding the drivename, partition, seg, etc., for two statements
> > nullifying most of the work:
> > 
> >   drivename = argv[1];
> >   partition = argv[2];		/* Possibly null */
> > 
> > Seeing as the function initializes the variables correctly at the
> > beginning:
> > 
> >   drivename = "boot";
> >   partition = NULL;
> > 
> > shouldn't these statements be removed?
> > 
> > This in syslinux-3.81-pre2.

Current git contains it also

> Probably.  Will look into it.


I think it should be

diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index ead908f..7c7c9eb 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -651,9 +651,6 @@ int main(int argc, char *argv[])
     regs.ip = regs.esp.l = 0x7c00;
   }
 
-  drivename = argv[1];
-  partition = argv[2];		/* Possibly null */
-
   hd = 0;
   if ( !strncmp(drivename, "mbr", 3) ) {
     drive = find_disk(strtoul(drivename+4, NULL, 0));



otherwise consider this a reminder


Cheers
Geert Stappers




More information about the Syslinux mailing list