From 3922276de4aea822f7445d47333e9718f1aa5510 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 2 Jun 2013 18:09:13 +0000 Subject: [PATCH] Initialize the frame_table_size field of the private data to 0 and the frame_table field to NULL before trying to allocate the frame table, so that if we fail before we allocate the frame table, the attempt to free the private data doesn't crash due to the frame_table field containing a bogus pointer. svn path=/trunk/; revision=49697 --- wiretap/netmon.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wiretap/netmon.c b/wiretap/netmon.c index 9f5d1b5578..ac5c5037d6 100644 --- a/wiretap/netmon.c +++ b/wiretap/netmon.c @@ -307,6 +307,15 @@ int netmon_open(wtap *wth, int *err, gchar **err_info) netmon->version_major = hdr.ver_major; netmon->version_minor = hdr.ver_minor; + /* + * No frame table allocated yet; initialize these in case we + * get an error before allocating it or when trying to allocate + * it, so that the attempt to release the private data on failure + * doesn't crash. + */ + netmon->frame_table_size = 0; + netmon->frame_table = NULL; + /* * Get the offset of the frame index table. */ -- 2.34.1