aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-04-25 00:45:09 -0700
committerGuy Harris <guy@alum.mit.edu>2017-04-25 07:46:02 +0000
commit4ac4ab31a32fd58e7180ba086baaabc48bd5f4a9 (patch)
treef34090b9cff7d5dfb46b73050dbc451ad629336a /epan
parent77751c94f17e2c110ae9e88b1780e279d610b96b (diff)
Don't crash if we have no BOOTP option preferences.
wmem_list_foreach() crashes if handed a null pointer, and saved_uat_opts will be null if there are no BOOTP option preferences. Don't do the "free saved UAT options" stuff if there aren't any saved UAT options. Bug: 13655 Change-Id: I88e64c6ebec88fc04a5adc0a85d378bbba49b383 Reviewed-on: https://code.wireshark.org/review/21329 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-bootp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c
index 500c12f5e5..6c590a6a6e 100644
--- a/epan/dissectors/packet-bootp.c
+++ b/epan/dissectors/packet-bootp.c
@@ -6340,10 +6340,13 @@ bootp_clear_uat_bootpopt(gpointer data, gpointer user_data _U_)
static void
bootp_cleanup_protocol(void)
{
- wmem_list_foreach(saved_uat_opts, bootp_clear_uat_bootpopt, NULL);
+ if (saved_uat_opts != NULL) {
+ wmem_list_foreach(saved_uat_opts, bootp_clear_uat_bootpopt,
+ NULL);
- wmem_destroy_list(saved_uat_opts);
- saved_uat_opts = NULL;
+ wmem_destroy_list(saved_uat_opts);
+ saved_uat_opts = NULL;
+ }
}