From dider
file.c time reference menu callback doesn't set cf->filter, it dumps a core if you have a file big enough in find next/ find prev. addr_resolv.c leak memory, break list chain when snooping address. svn path=/trunk/; revision=17419
This commit is contained in:
parent
7d208bc4e0
commit
0fc74ff335
|
@ -142,9 +142,9 @@
|
|||
|
||||
typedef struct hashipv4 {
|
||||
guint addr;
|
||||
gchar name[MAXNAMELEN];
|
||||
gboolean is_dummy_entry; /* name is IPv4 address in dot format */
|
||||
struct hashipv4 *next;
|
||||
gchar name[MAXNAMELEN];
|
||||
} hashipv4_t;
|
||||
|
||||
/* hash table used for IPv6 lookup */
|
||||
|
@ -1063,6 +1063,7 @@ static hashether_t *add_eth_name(const guint8 *addr, const gchar *name)
|
|||
{
|
||||
int hash_idx;
|
||||
hashether_t *tp;
|
||||
int new_one = TRUE;
|
||||
|
||||
hash_idx = HASH_ETH_ADDRESS(addr);
|
||||
|
||||
|
@ -1078,6 +1079,7 @@ static hashether_t *add_eth_name(const guint8 *addr, const gchar *name)
|
|||
return tp;
|
||||
} else {
|
||||
/* replace this dummy (manuf) entry with a real name */
|
||||
new_one = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1090,10 +1092,12 @@ static hashether_t *add_eth_name(const guint8 *addr, const gchar *name)
|
|||
}
|
||||
}
|
||||
|
||||
memcpy(tp->addr, addr, sizeof(tp->addr));
|
||||
strncpy(tp->name, name, MAXNAMELEN);
|
||||
tp->name[MAXNAMELEN-1] = '\0';
|
||||
tp->next = NULL;
|
||||
if (new_one) {
|
||||
memcpy(tp->addr, addr, sizeof(tp->addr));
|
||||
tp->next = NULL;
|
||||
}
|
||||
tp->is_dummy_entry = FALSE;
|
||||
|
||||
return tp;
|
||||
|
@ -1795,6 +1799,7 @@ extern void add_ipv4_name(guint addr, const gchar *name)
|
|||
{
|
||||
int hash_idx;
|
||||
hashipv4_t *tp;
|
||||
int new_one = TRUE;
|
||||
|
||||
hash_idx = HASH_IPV4_ADDRESS(addr);
|
||||
|
||||
|
@ -1810,6 +1815,7 @@ extern void add_ipv4_name(guint addr, const gchar *name)
|
|||
return;
|
||||
} else {
|
||||
/* replace this dummy entry with the new one */
|
||||
new_one = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1824,8 +1830,10 @@ extern void add_ipv4_name(guint addr, const gchar *name)
|
|||
|
||||
strncpy(tp->name, name, MAXNAMELEN);
|
||||
tp->name[MAXNAMELEN-1] = '\0';
|
||||
tp->addr = addr;
|
||||
tp->next = NULL;
|
||||
if (new_one) {
|
||||
tp->addr = addr;
|
||||
tp->next = NULL;
|
||||
}
|
||||
tp->is_dummy_entry = FALSE;
|
||||
|
||||
} /* add_ipv4_name */
|
||||
|
@ -1834,6 +1842,7 @@ extern void add_ipv6_name(struct e_in6_addr *addrp, const gchar *name)
|
|||
{
|
||||
int hash_idx;
|
||||
hashipv6_t *tp;
|
||||
int new_one = TRUE;
|
||||
|
||||
hash_idx = HASH_IPV6_ADDRESS(*addrp);
|
||||
|
||||
|
@ -1849,6 +1858,7 @@ extern void add_ipv6_name(struct e_in6_addr *addrp, const gchar *name)
|
|||
return;
|
||||
} else {
|
||||
/* replace this dummy entry with the new one */
|
||||
new_one = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1863,8 +1873,10 @@ extern void add_ipv6_name(struct e_in6_addr *addrp, const gchar *name)
|
|||
|
||||
strncpy(tp->name, name, MAXNAMELEN);
|
||||
tp->name[MAXNAMELEN-1] = '\0';
|
||||
tp->addr = *addrp;
|
||||
tp->next = NULL;
|
||||
if (new_one) {
|
||||
tp->addr = *addrp;
|
||||
tp->next = NULL;
|
||||
}
|
||||
tp->is_dummy_entry = FALSE;
|
||||
|
||||
} /* add_ipv6_name */
|
||||
|
|
4
file.c
4
file.c
|
@ -2742,6 +2742,7 @@ find_packet(capture_file *cf,
|
|||
gchar status_str[100];
|
||||
int progbar_nextstep;
|
||||
int progbar_quantum;
|
||||
char *title;
|
||||
|
||||
start_fd = cf->current_frame;
|
||||
if (start_fd != NULL) {
|
||||
|
@ -2763,6 +2764,7 @@ find_packet(capture_file *cf,
|
|||
g_get_current_time(&start_time);
|
||||
|
||||
fdata = start_fd;
|
||||
title = cf->sfilter?cf->sfilter:"";
|
||||
for (;;) {
|
||||
/* Create the progress bar if necessary.
|
||||
We check on every iteration of the loop, so that it takes no
|
||||
|
@ -2770,7 +2772,7 @@ find_packet(capture_file *cf,
|
|||
large file, we might take considerably longer than that standard
|
||||
time in order to get to the next progress bar step). */
|
||||
if (progbar == NULL)
|
||||
progbar = delayed_create_progress_dlg("Searching", cf->sfilter,
|
||||
progbar = delayed_create_progress_dlg("Searching", title,
|
||||
FALSE, &stop_flag, &start_time, progbar_val);
|
||||
|
||||
/* Update the progress bar, but do it only N_PROGBAR_UPDATES times;
|
||||
|
|
Loading…
Reference in New Issue