(/home/sate/Testcases/c/cve/wireshark-1.2.0/gtk/io_stat.c) |
| |
| 655 | | | print_interval_string(char *buf, int buf_len, guint32 interval, io_stat_t *io, |
| 656 | | | gboolean ext) |
| 657 | | | { |
| 658 | | | if (io->view_as_time) { |
Event 1:
Taking true branch. io->view_as_time evaluates to true.
hide
|
|
| 659 | | | struct tm *tmp; |
| 660 | | | time_t sec_val = interval/1000 + io->start_time.secs; |
| 661 | | | gint32 nsec_val = interval%1000 + io->start_time.nsecs/1000000; |
| 662 | | | |
| 663 | | | if(nsec_val >= 1000) { |
Event 2:
Skipping " if". nsec_val >= 1000 evaluates to false.
hide
|
|
| 664 | | | sec_val++; |
| 665 | | | nsec_val -= 1000; |
| 666 | | | } |
| 667 | | | tmp = localtime (&sec_val); |
Event 3:
localtime() returns NULL. - Dereferenced later, causing the null pointer dereference.
hide
Event 4:
tmp is set to localtime(&sec_val), which evaluates to NULL. See related event 3.
hide
|
|
| 668 | | | if(io->interval>=1000){ |
Event 5:
Taking true branch. io->interval >= 1000 evaluates to true.
hide
|
|
| 669 | | | g_snprintf(buf, buf_len, "%02d:%02d:%02d", tmp->tm_hour, tmp->tm_min, tmp->tm_sec); |
Null Pointer Dereference
tmp is dereferenced here, but it is NULL. The issue can occur if the highlighted code executes. See related event 4. Show: All events | Only primary events |
|
| |