emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master d942c39: Avoid yet another possible NULL pointer de


From: Dmitry Antipov
Subject: [Emacs-diffs] master d942c39: Avoid yet another possible NULL pointer dereference found by GCC 6.1.1
Date: Fri, 1 Jul 2016 15:50:45 +0000 (UTC)

branch: master
commit d942c39c44dac1d73f9413979f754fa551f96cbb
Author: Dmitry Antipov <address@hidden>
Commit: Dmitry Antipov <address@hidden>

    Avoid yet another possible NULL pointer dereference found by GCC 6.1.1
    
    * lwlib/lwlib.c (lw_get_all_values): Always check the value returned by
    get_widget_info.
---
 lwlib/lwlib.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c
index c68cf77..d1c5195 100644
--- a/lwlib/lwlib.c
+++ b/lwlib/lwlib.c
@@ -1042,11 +1042,13 @@ widget_value*
 lw_get_all_values (LWLIB_ID id)
 {
   widget_info* info = get_widget_info (id, False);
-  widget_value* val = info->val;
-  if (lw_get_some_values (id, val))
-    return val;
-  else
-    return NULL;
+  if (info)
+    {
+      widget_value* val = info->val;
+      if (lw_get_some_values (id, val))
+       return val;
+    }
+  return NULL;
 }
 
 /* internal function used by the library dependent implementation to get the



reply via email to

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