bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] avoid NULL deref in initialization


From: Jim Meyering
Subject: [PATCH] avoid NULL deref in initialization
Date: Sat, 11 Jun 2011 09:02:57 +0200

This fixes another coverity-spotted issue:

2011-06-11  Jim Meyering  <address@hidden>

        avoid NULL deref in initialization
        * grub-core/gettext/gettext.c (GRUB_MOD_INIT): If grub_env_get ("lang")
        returns NULL, use "C".


=== modified file 'grub-core/gettext/gettext.c'
--- grub-core/gettext/gettext.c 2011-04-11 21:01:51 +0000
+++ grub-core/gettext/gettext.c 2011-06-11 07:00:41 +0000
@@ -375,6 +375,8 @@
   const char *lang;

   lang = grub_env_get ("lang");
+  if (lang == NULL)
+    lang = "C";

   grub_gettext_init_ext (lang);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]