From 1438d28768023cc185a3fa4237cb2842bbb5df31 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 10 Jun 2016 00:31:36 -0700 Subject: [PATCH] Set the size of the packet counts array when we create it. g_array_sized_new() sets the amount of *space allocated for* the array, but doesn't actually set its *length*. Change-Id: Ia7deab34c758c88910dfb0e246a6903301e68029 Reviewed-on: https://code.wireshark.org/review/15806 Reviewed-by: Guy Harris --- capinfos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/capinfos.c b/capinfos.c index 2261e7e6e1..f36e07a633 100644 --- a/capinfos.c +++ b/capinfos.c @@ -1107,6 +1107,7 @@ process_cap_file(wtap *wth, const char *filename) cf_info.num_interfaces = idb_info->interface_data->len; cf_info.interface_packet_counts = g_array_sized_new(FALSE, TRUE, sizeof(guint32), cf_info.num_interfaces); + g_array_set_size(cf_info.interface_packet_counts, cf_info.num_interfaces); cf_info.pkt_interface_id_unknown = 0; g_free(idb_info);