(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/iax2_analysis.c) |
| |
| 609 | | | static int iax2_packet_add_info(GtkWidget *list, user_data_t * user_data, |
| 610 | | | tap_iax2_stat_t *statinfo, packet_info *pinfo, |
| 611 | | | const struct _iax2_info_t *iax2info _U_) |
| 612 | | | { |
| 613 | | | guint16 msecs; |
| 614 | | | gchar timeStr[32]; |
| 615 | | | struct tm *tm_tmp; |
| 616 | | | time_t then; |
| 617 | | | gchar status[40]; |
| 618 | | | GdkColor color = COLOR_DEFAULT; |
| 619 | | | gchar color_str[14]; |
| 620 | | | then = pinfo->fd->abs_ts.secs; |
| 621 | | | msecs = (guint16)(pinfo->fd->abs_ts.nsecs/1000000); |
| 622 | | | tm_tmp = localtime(&then); |
Event 1:
localtime() returns NULL. - Dereferenced later, causing the null pointer dereference.
hide
Event 2:
tm_tmp is set to localtime(&then), which evaluates to NULL. See related event 1.
hide
|
|
| 623 | | | g_snprintf(timeStr,sizeof(timeStr),"%02d/%02d/%04d %02d:%02d:%02d.%03d", |
| 624 | | | tm_tmp->tm_mon + 1, |
| 625 | | | tm_tmp->tm_mday, |
| 626 | | | tm_tmp->tm_year + 1900, |
| 627 | | | tm_tmp->tm_hour, |
| 628 | | | tm_tmp->tm_min, |
| 629 | | | tm_tmp->tm_sec, |
Null Pointer Dereference
tm_tmp is dereferenced here, but it is NULL. The issue can occur if the highlighted code executes. See related event 2. Show: All events | Only primary events |
|
| 630 | | | msecs); |
| |