diff mbox

long append="..." causes yaboot to reject entire yaboot.conf (MAX_TOKEN too small)

Message ID 491C089F.7070400@redhat.com
State Accepted
Headers show

Commit Message

Roman Rakus Nov. 13, 2008, 10:59 a.m. UTC
Hello.

/From Will Woods (wwoods@redhat.com <mailto:wwoods@redhat.com>)/
"""

yaboot's second/cfg.c has:
  #define MAX_TOKEN 200

When yaboot parses its config file, if it encounters a quoted string (like
append="...") longer than MAX_TOKEN, it rejects the entire config.

Typical preupgrade usage uses ~250 chars, which means preupgrade currently
renders ppc systems unbootable without this patch.

Suggest increasing MAX_TOKEN to.. let's say 511. cfg.c does "char
buf[MAX_TOKEN+1]", and everyone loves powers of 2.
"""
Will it be in next release?
RR
diff mbox

Patch

diff -up yaboot-1.3.14/second/cfg.c.bigger-max-token yaboot-1.3.14/second/cfg.c
--- yaboot-1.3.14/second/cfg.c.bigger-max-token	2008-11-12 14:39:11.000000000 -0500
+++ yaboot-1.3.14/second/cfg.c	2008-11-12 14:39:17.000000000 -0500
@@ -41,7 +41,7 @@  typedef struct {
      void *data;
 } CONFIG;
 
-#define MAX_TOKEN 200
+#define MAX_TOKEN 511
 #define MAX_VAR_NAME MAX_TOKEN
 #define EOF -1