[syslinux] [menu] Bug: 'cm' is used before it is initialized

CKSoon cksoon79 at yahoo.com
Sun Aug 16 18:26:01 PDT 2009


Hi,

I'm seeing a problem on my system where the PXELINUX (and also the ISOLINUX) keep on prompting me the "Initial menu has no LABEL
entries!" message, when vesamenu.c32 or menu.c32 is executed. 

After some investigation, I found that the global cm used in menu_main before it is initialized, and hence it carries a NULL value. I manage to get my system to display the menu after I bypass the code checking !cm->nentries (shown below). Note that not all system will see the same problem because it depends on what the content of cm->nentries when cm is NULL.

I'm seeing the problem on syslinux 3.82 and I believe the problem exists in some previous versions. I've tried syslinux 3.54 which doesn't have the following code and it manage to show the menu correctly. Sample of the menu configuration file I used: http://clonezilla.org/.

Code: menu_main(), .\com32\menu\menumain.c
------------------------------------------
  .
  .
  .
  if ( !cm->nentries ) { <--------------------------- cm is NULL
    fputs("Initial menu has no LABEL entries!\n", stdout);
    return 1;            /* Error! */
  }

  cm = start_menu; <---------------------- cm is initialized here
  .
  .
  .


      




More information about the Syslinux mailing list