vesamenu: avoid strcmp() with NULL
authorH. Peter Anvin <hpa@zytor.com>
Tue, 22 Jul 2008 01:36:44 +0000 (21:36 -0400)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 22 Jul 2008 16:58:01 +0000 (12:58 -0400)
Avoid touching memory at address zero when going from a background to
a non-background.

com32/menu/background.c

index 49839cd..fa03441 100644 (file)
@@ -18,7 +18,7 @@ const char *current_background = NULL;
 
 void set_background(const char *new_background)
 {
-  if (!current_background ||
+  if (!current_background || !new_background ||
       strcmp(current_background, new_background)) {
     draw_background(new_background);
     current_background = new_background;