From: hpa Date: Thu, 18 Aug 2005 23:48:47 +0000 (+0000) Subject: Handle MENU PASSWD correctly X-Git-Tag: syslinux-3.11~60 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2932034058a45a8e169b6b791975253c179827b;p=profile%2Fivi%2Fsyslinux.git Handle MENU PASSWD correctly --- diff --git a/NEWS b/NEWS index 54a880b..ba4ebbf 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,8 @@ Changes in 3.10: * Fix for bug in EBIOS code discovered by Arwin Vosselman. * NOESCAPE security fix. * Comments are now recognized even without a space following #. + * Fix incorrect handling of mixes of entries with and without + MENU PASSWD. Changes in 3.09: * gcc4 compilation fix. diff --git a/com32/modules/readconfig.c b/com32/modules/readconfig.c index 49a81af..fccc764 100644 --- a/com32/modules/readconfig.c +++ b/com32/modules/readconfig.c @@ -137,7 +137,7 @@ record(struct labeldata *ld, char *append) me->hotkey = 0; if ( ld->menulabel ) { - unsigned char *p = strchr(ld->menulabel, '^'); + unsigned char *p = (unsigned char *)strchr(ld->menulabel, '^'); if ( p && p[1] ) { int hotkey = p[1] & ~0x20; if ( !menu_hotkeys[hotkey] ) { @@ -160,9 +160,15 @@ record(struct labeldata *ld, char *append) asprintf(&me->cmdline, "%s%s%s%s", ld->kernel, ipoptions, s, a); ld->label = NULL; + ld->passwd = NULL; + free(ld->kernel); - if ( ld->append ) + ld->kernel = NULL; + + if ( ld->append ) { free(ld->append); + ld->append = NULL; + } if ( !ld->menuhide ) { if ( me->hotkey ) @@ -235,6 +241,7 @@ void parse_config(const char *filename) record(&ld, append); ld.label = strdup(p); ld.kernel = strdup(p); + ld.passwd = NULL; ld.append = NULL; ld.menulabel = NULL; ld.ipappend = ld.menudefault = ld.menuhide = 0;