(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/mac_lte_stat_dlg.c) |
| |
| 399 | | | mac_lte_ue_details(mac_lte_ep_t *mac_stat_ep) |
| 400 | | | { |
| 401 | | | int n; |
| 402 | | | gchar buff[32]; |
| 403 | | | |
| 404 | | | |
| 405 | | | |
| 406 | | | |
| 407 | | | |
| 408 | | | for (n=0; n < PREDEFINED_COLUMN-1; n++) { |
Event 1:
Performing all but the last loop iteration.
hide
Event 2:
Continuing from loop body. Entering loop body. n < PREDEFINED_COLUMN - 1 evaluates to true.
hide
Event 9:
Continuing from loop body. Leaving loop. n < PREDEFINED_COLUMN - 1 evaluates to false.
hide
|
|
| 409 | | | g_snprintf(buff, sizeof(buff), "%u", mac_stat_ep ? mac_stat_ep->stats.UL_sdus_for_lcid[n] : 0); |
| 410 | | | gtk_label_set_text(GTK_LABEL(selected_ue_column_entry[n+1][1]), buff);
x /usr/include/gtk-2.0/gtk/gtklabel.h |
| |
42 | #define GTK_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LABEL, GtkLabel)) |
| |
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/gtklabel.h |
| |
41 | #define GTK_TYPE_LABEL (gtk_label_get_type ()) |
| |
|
| 411 | | | } |
| 412 | | | |
| 413 | | | |
| 414 | | | if (mac_stat_ep) { |
Null Test After Dereference
This code tests the nullness of mac_stat_ep, which has already been dereferenced. - If mac_stat_ep were null, there would have been a prior null pointer dereference at mac_lte_stat_dlg.c:409, and potentially at other locations as well.
- Either this test is redundant, or the earlier dereference(s) should be guarded by a similar test.
The issue can occur if the highlighted code executes. See related event 4. Show: All events | Only primary events |
|
| 415 | | | g_snprintf(buff, sizeof(buff), "%u", mac_stat_ep->stats.is_predefined_data ? |
| 416 | | | mac_stat_ep->stats.UL_frames : |
| 417 | | | 0); |
| 418 | | | } |
| 419 | | | else { |
| 420 | | | g_snprintf(buff, sizeof(buff), "%u", 0); |
| 421 | | | } |
| 422 | | | gtk_label_set_text(GTK_LABEL(selected_ue_column_entry[PREDEFINED_COLUMN][1]), buff);
x /usr/include/gtk-2.0/gtk/gtklabel.h |
| |
42 | #define GTK_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LABEL, GtkLabel)) |
| |
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/gtklabel.h |
| |
41 | #define GTK_TYPE_LABEL (gtk_label_get_type ()) |
| |
|
| 423 | | | |
| 424 | | | |
| 425 | | | |
| 426 | | | for (n=0; n < PREDEFINED_COLUMN-1; n++) { |
| 427 | | | g_snprintf(buff, sizeof(buff), "%u", |
| 428 | | | (mac_stat_ep) ? mac_stat_ep->stats.UL_bytes_for_lcid[n] : 0); |
| 429 | | | gtk_label_set_text(GTK_LABEL(selected_ue_column_entry[n+1][2]), buff);
x /usr/include/gtk-2.0/gtk/gtklabel.h |
| |
42 | #define GTK_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LABEL, GtkLabel)) |
| |
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/gtklabel.h |
| |
41 | #define GTK_TYPE_LABEL (gtk_label_get_type ()) |
| |
|
| 430 | | | } |
| 431 | | | |
| 432 | | | |
| 433 | | | if (mac_stat_ep) { |
| 434 | | | g_snprintf(buff, sizeof(buff), "%u", mac_stat_ep->stats.is_predefined_data ? |
| 435 | | | mac_stat_ep->stats.UL_total_bytes : |
| 436 | | | 0); |
| 437 | | | } |
| 438 | | | else { |
| 439 | | | g_snprintf(buff, sizeof(buff), "%u", 0); |
| 440 | | | } |
| 441 | | | gtk_label_set_text(GTK_LABEL(selected_ue_column_entry[PREDEFINED_COLUMN][2]), buff);
x /usr/include/gtk-2.0/gtk/gtklabel.h |
| |
42 | #define GTK_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LABEL, GtkLabel)) |
| |
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/gtklabel.h |
| |
41 | #define GTK_TYPE_LABEL (gtk_label_get_type ()) |
| |
|
| 442 | | | |
| 443 | | | |
| 444 | | | |
| 445 | | | for (n=0; n < PREDEFINED_COLUMN-1; n++) { |
| 446 | | | g_snprintf(buff, sizeof(buff), "%u", |
| 447 | | | mac_stat_ep ? mac_stat_ep->stats.DL_sdus_for_lcid[n] : 0); |
| 448 | | | gtk_label_set_text(GTK_LABEL(selected_ue_column_entry[n+1][3]), buff);
x /usr/include/gtk-2.0/gtk/gtklabel.h |
| |
42 | #define GTK_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LABEL, GtkLabel)) |
| |
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/gtklabel.h |
| |
41 | #define GTK_TYPE_LABEL (gtk_label_get_type ()) |
| |
|
| 449 | | | } |
| 450 | | | |
| 451 | | | if (mac_stat_ep) { |
| 452 | | | g_snprintf(buff, sizeof(buff), "%u", mac_stat_ep->stats.is_predefined_data ? |
| 453 | | | mac_stat_ep->stats.DL_frames : |
| 454 | | | 0); |
| 455 | | | } |
| 456 | | | else { |
| 457 | | | g_snprintf(buff, sizeof(buff), "%u", 0); |
| 458 | | | } |
| 459 | | | gtk_label_set_text(GTK_LABEL(selected_ue_column_entry[PREDEFINED_COLUMN][3]), buff);
x /usr/include/gtk-2.0/gtk/gtklabel.h |
| |
42 | #define GTK_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LABEL, GtkLabel)) |
| |
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/gtklabel.h |
| |
41 | #define GTK_TYPE_LABEL (gtk_label_get_type ()) |
| |
|
| 460 | | | |
| 461 | | | |
| 462 | | | |
| 463 | | | for (n=0; n < PREDEFINED_COLUMN-1; n++) { |
| 464 | | | g_snprintf(buff, sizeof(buff), "%u", |
| 465 | | | mac_stat_ep ? mac_stat_ep->stats.DL_bytes_for_lcid[n] : 0); |
| 466 | | | gtk_label_set_text(GTK_LABEL(selected_ue_column_entry[n+1][4]), buff);
x /usr/include/gtk-2.0/gtk/gtklabel.h |
| |
42 | #define GTK_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LABEL, GtkLabel)) |
| |
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/gtklabel.h |
| |
41 | #define GTK_TYPE_LABEL (gtk_label_get_type ()) |
| |
|
| 467 | | | } |
| 468 | | | |
| 469 | | | if (mac_stat_ep) { |
| 470 | | | g_snprintf(buff, sizeof(buff), "%u", mac_stat_ep->stats.is_predefined_data ? |
| 471 | | | mac_stat_ep->stats.DL_total_bytes : |
| 472 | | | 0); |
| 473 | | | } |
| 474 | | | else { |
| 475 | | | g_snprintf(buff, sizeof(buff), "%u", 0); |
| 476 | | | } |
| 477 | | | gtk_label_set_text(GTK_LABEL(selected_ue_column_entry[PREDEFINED_COLUMN][4]), buff);
x /usr/include/gtk-2.0/gtk/gtklabel.h |
| |
42 | #define GTK_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LABEL, GtkLabel)) |
| |
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/gtklabel.h |
| |
41 | #define GTK_TYPE_LABEL (gtk_label_get_type ()) |
| |
|
| 478 | | | } |
| |