aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/wtap.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2012-03-16 14:07:22 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2012-03-16 14:07:22 +0000
commitfb46cda196020ba9c0bee0df214f551e38f6a530 (patch)
treed235624e2876a383623b9cbcd22df1e0c9bac4cd /wiretap/wtap.c
parent96e944c8ef7b6ee61de9c8084cee7f14abb70e88 (diff)
When we're in a for(i=0,[...]) loop, don't reuse (and thus reset) 'i' in another for(i=0,[...]) loop. This fixes the capinfos double-free crashes that the fuzz bot has been experiencing.
svn path=/trunk/; revision=41610
Diffstat (limited to 'wiretap/wtap.c')
-rw-r--r--wiretap/wtap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index 9485ba7c7d..7bdd1bf919 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -718,7 +718,7 @@ g_fast_seek_item_free(gpointer data, gpointer user_data _U_)
void
wtap_close(wtap *wth)
{
- gint i;
+ gint i, j;
wtapng_if_descr_t *wtapng_if_descr;
wtapng_if_stats_t *if_stats;
@@ -757,8 +757,8 @@ wtap_close(wtap *wth)
if(wtapng_if_descr->if_os != NULL){
g_free(wtapng_if_descr->if_os);
}
- for(i = 0; i < (gint)wtapng_if_descr->num_stat_entries; i++) {
- if_stats = &g_array_index(wtapng_if_descr->interface_statistics, wtapng_if_stats_t, i);
+ for(j = 0; j < (gint)wtapng_if_descr->num_stat_entries; j++) {
+ if_stats = &g_array_index(wtapng_if_descr->interface_statistics, wtapng_if_stats_t, j);
if(if_stats->opt_comment != NULL){
g_free(if_stats->opt_comment);
}