From b8ce60936e54ba60170149f68d420899ee04fc89 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 21 Oct 2016 17:51:53 +0100 Subject: [PATCH] init: don't read NULL pointers Needed for the 68K port as it causes a trap --- Applications/util/init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.34.1