(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/k12text.c) |
| |
| 2457 | | | static gboolean k12text_dump(wtap_dumper *wdh _U_, const struct wtap_pkthdr *phdr, |
| 2458 | | | const union * _U_, |
| 2459 | | | const guchar *pd, int *err _U_) { |
| 2460 | | | char buf[196808]; |
| 2461 | | | size_t left = 196808; |
| 2462 | | | gint wl; |
| 2463 | | | char* p=buf; |
| 2464 | | | const char* str_enc = ""; |
| 2465 | | | guint i; |
| 2466 | | | guint ns; |
| 2467 | | | guint ms; |
| 2468 | | | |
| 2469 | | | ms = phdr->ts.nsecs / 1000000; |
| 2470 | | | ns = (phdr->ts.nsecs - (1000000*ms))/1000; |
| 2471 | | | |
| 2472 | | | for(i=0; encaps[i].s; i++) { |
Event 1:
Leaving loop. encaps[i].s evaluates to false.
hide
|
|
| 2473 | | | str_enc = encaps[i].s; |
| 2474 | | | if (phdr->pkt_encap == encaps[i].e) break; |
| 2475 | | | } |
| 2476 | | | |
| 2477 | | | strftime(p,90,"+---------+---------------+----------+\r\n%H:%M:%S,",gmtime(&phdr->ts.secs)); |
Event 2:
gmtime() returns NULL. - Dereferenced later, causing the null pointer dereference.
hide
Event 3:
gmtime(&phdr->ts.secs), which evaluates to NULL, is passed to strftime() as the fourth argument. See related event 2.
hide
Null Pointer Dereference
The body of strftime() dereferences gmtime(&phdr->ts.secs), but it is NULL. The issue can occur if the highlighted code executes. See related event 3. Show: All events | Only primary events |
|
| |