(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/rtp_analysis.c) |
| |
| 530 | | | static int rtp_packet_add_info(GtkWidget *list, user_data_t * user_data, |
| 531 | | | tap_rtp_stat_t *statinfo, packet_info *pinfo, |
| 532 | | | const struct _rtp_info *rtpinfo) |
| 533 | | | { |
| 534 | | | guint16 msecs; |
| 535 | | | gchar timeStr[32]; |
| 536 | | | struct tm *tm_tmp; |
| 537 | | | time_t then; |
| 538 | | | gchar status[40]; |
| 539 | | | gchar color_str[14]; |
| 540 | | | then = pinfo->fd->abs_ts.secs; |
| 541 | | | msecs = (guint16)(pinfo->fd->abs_ts.nsecs/1000000); |
| 542 | | | 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
|
|
| 543 | | | g_snprintf(timeStr,sizeof(timeStr),"%02d/%02d/%04d %02d:%02d:%02d.%03d", |
| 544 | | | tm_tmp->tm_mon + 1, |
| 545 | | | tm_tmp->tm_mday, |
| 546 | | | tm_tmp->tm_year + 1900, |
| 547 | | | tm_tmp->tm_hour, |
| 548 | | | tm_tmp->tm_min, |
| 549 | | | 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 |
|
| 550 | | | msecs); |
| |