(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/mcast_stream_dlg.c) |
| |
| 181 | | | mcaststream_on_filter (GtkButton *button _U_, |
| 182 | | | gpointer user_data _U_) |
| 183 | | | { |
| 184 | | | gchar *filter_string = NULL; |
| 185 | | | gchar *filter_string_fwd = NULL; |
| 186 | | | gchar ip_version[3]; |
| 187 | | | |
| 188 | | | if (selected_stream_fwd==NULL) |
| 189 | | | return; |
| 190 | | | |
| 191 | | | if (selected_stream_fwd) |
Redundant Condition
selected_stream_fwd always evaluates to true. This may be because: - There is a constant assignment to one or more of the variables involved.
- An earlier conditional statement has already ensured that selected_stream_fwd cannot be false.
- A crashing bug occurs on every path where selected_stream_fwd could have evaluated to false. Look for a preceding Null Pointer Dereference or Division By Zero warning.
|
|
| 192 | | | { |
| 193 | | | if (selected_stream_fwd->src_addr.type==AT_IPv6){ |
| 194 | | | g_strlcpy(ip_version,"v6",sizeof(ip_version)); |
| 195 | | | } |
| 196 | | | else{ |
| 197 | | | ip_version[0] = '\0'; |
| 198 | | | } |
| 199 | | | filter_string_fwd = g_strdup_printf( |
| 200 | | | "(ip%s.src==%s && udp.srcport==%u && ip%s.dst==%s && udp.dstport==%u)", |
| 201 | | | ip_version, |
| 202 | | | address_to_str(&(selected_stream_fwd->src_addr)), |
| 203 | | | selected_stream_fwd->src_port, |
| 204 | | | ip_version, |
| 205 | | | address_to_str(&(selected_stream_fwd->dest_addr)), |
| 206 | | | selected_stream_fwd->dest_port); |
| 207 | | | filter_string = filter_string_fwd; |
| 208 | | | } |
| 209 | | | |
| 210 | | | gtk_entry_set_text(GTK_ENTRY(main_display_filter_widget), filter_string);
x /usr/include/gtk-2.0/gtk/gtkentry.h |
| |
51 | #define GTK_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ENTRY, GtkEntry)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
482 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) |
| |
x /usr/include/glib-2.0/gobject/gtype.h |
| |
1678 | # define _G_TYPE_CIC(ip, gt, ct) \ |
1679 | ((ct*) g_type_check_instance_cast ((GTypeInstance*) ip, gt)) |
| |
x /usr/include/gtk-2.0/gtk/gtkentry.h |
| |
50 | #define GTK_TYPE_ENTRY (gtk_entry_get_type ()) |
| |
|
| 211 | | | g_free(filter_string); |
| 212 | | | |
| 213 | | | |
| 214 | | | |
| 215 | | | |
| 216 | | | |
| 217 | | | } |
| |