aboutsummaryrefslogtreecommitdiffstats
path: root/extcap/sshdump.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-04-12 08:45:20 +0200
committerPeter Wu <peter@lekensteyn.nl>2016-04-12 08:21:17 +0000
commitbee73f5d049c5436ffff87a7e0c5eab600e8df28 (patch)
tree550a12555a7e1bab80a363ad1550b92d20443a83 /extcap/sshdump.c
parentf9b688226a71c1ced36ad0b70bb4796d1a5c12b3 (diff)
sshdump,ciscodump: fix local addresses discovery
Fixes a NULL-deref when no interface addresses are discovered. Remove NULL interface from list (an empty GSList is represented by NULL while g_slist_alloc returns a list with a single NULL data). Change-Id: I2eded40bb697e051445a526d1f34d8a50ef9ccd4 Reviewed-on: https://code.wireshark.org/review/14888 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'extcap/sshdump.c')
-rw-r--r--extcap/sshdump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/extcap/sshdump.c b/extcap/sshdump.c
index 77dc11ad04..92ea9fded0 100644
--- a/extcap/sshdump.c
+++ b/extcap/sshdump.c
@@ -268,9 +268,9 @@ static char* interfaces_list_to_filter(GSList* interfaces, unsigned int remote_p
} else {
g_string_append_printf(filter, "not ((host %s", (char*)interfaces->data);
cur = g_slist_next(interfaces);
- while (cur->next != NULL) {
+ while (cur) {
g_string_append_printf(filter, " or host %s", (char*)cur->data);
- cur = cur->next;
+ cur = g_slist_next(cur);
}
g_string_append_printf(filter, ") and port %u)", remote_port);
}