From: Alan Cox Date: Fri, 21 Oct 2016 16:51:53 +0000 (+0100) Subject: init: don't read NULL pointers X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b8ce60936e54ba60170149f68d420899ee04fc89;p=FUZIX.git init: don't read NULL pointers Needed for the 68K port as it causes a trap --- diff --git a/Applications/util/init.c b/Applications/util/init.c index d9894888..e2282fdc 100644 --- a/Applications/util/init.c +++ b/Applications/util/init.c @@ -630,7 +630,6 @@ static int envn; static void envset(const char *a, const char *b) { int al = strlen(a); - static char hptr[5]; /* May unalign the memory pool but we don't care by this point */ char *tp = sbrk(al + strlen(b) + 2); if (tp == (char *) -1) { @@ -688,6 +687,9 @@ const char *bauds[] = { static int baudmatch(const char *p) { const char **str = bauds; + if (p == NULL) + return B9600; + int i; for(i = 1; i < 15; i++) { if (strcmp(p, *str++) == 0)