From 85f49f1d4919fb2fbcafd374863ba9528ede9aef Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sat, 17 Jun 2006 11:11:34 +0000 Subject: [PATCH] fix for coverity 182 this bug can not currently trigger but if someone would rename the module in the future then this could potentially cause a null dereference. svn path=/trunk/; revision=18494 --- epan/prefs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/epan/prefs.c b/epan/prefs.c index 0257601957..f825d8bbe0 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -2005,10 +2005,12 @@ set_pref(gchar *pref_name, gchar *value) } else if (strcmp(module->name, "smpp") == 0) { /* Handle preferences that moved from SMPP. */ module_t *new_module = find_module("gsm-sms-ud"); - if (strcmp(dotp, "port_number_udh_means_wsp") == 0) - pref = find_preference(new_module, "port_number_udh_means_wsp"); - else if (strcmp(dotp, "try_dissect_1st_fragment") == 0) - pref = find_preference(new_module, "try_dissect_1st_fragment"); + if(new_module){ + if (strcmp(dotp, "port_number_udh_means_wsp") == 0) + pref = find_preference(new_module, "port_number_udh_means_wsp"); + else if (strcmp(dotp, "try_dissect_1st_fragment") == 0) + pref = find_preference(new_module, "try_dissect_1st_fragment"); + } } else if (strcmp(module->name, "asn1") == 0) { /* Handle old generic ASN.1 preferences (it's not really a rename, as the new preferences support multiple ports,