aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Antipov2016-07-01 18:45:24 +0300
committerDmitry Antipov2016-07-01 18:45:24 +0300
commitd942c39c44dac1d73f9413979f754fa551f96cbb (patch)
tree249965b28f35fc9601bf881156af045ae0858160
parent55e4e83cf449ce74f97f72f728cd3e935cc8d412 (diff)
downloademacs-d942c39c44dac1d73f9413979f754fa551f96cbb.tar.gz
emacs-d942c39c44dac1d73f9413979f754fa551f96cbb.zip
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.
-rw-r--r--lwlib/lwlib.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c
index c68cf77c928..d1c5195dbf9 100644
--- a/lwlib/lwlib.c
+++ b/lwlib/lwlib.c
@@ -1042,11 +1042,13 @@ widget_value*
1042lw_get_all_values (LWLIB_ID id) 1042lw_get_all_values (LWLIB_ID id)
1043{ 1043{
1044 widget_info* info = get_widget_info (id, False); 1044 widget_info* info = get_widget_info (id, False);
1045 widget_value* val = info->val; 1045 if (info)
1046 if (lw_get_some_values (id, val)) 1046 {
1047 return val; 1047 widget_value* val = info->val;
1048 else 1048 if (lw_get_some_values (id, val))
1049 return NULL; 1049 return val;
1050 }
1051 return NULL;
1050} 1052}
1051 1053
1052/* internal function used by the library dependent implementation to get the 1054/* internal function used by the library dependent implementation to get the