(/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; |
Event 1:
p is set to buf.
hide
|
|
| 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 2:
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 3:
strftime() does not initialize buf. - This may be because of a failure case or other special case for strftime(). Consult the strftime() documentation for more information.
hide
|
|
| 2478 | | | wl = strlen(p); |
Event 4:
p, which evaluates to buf, is passed to __builtin_strlen(). See related event 1.
hide
Uninitialized Variable
*p was not initialized, but is used inside __builtin_strlen(). The issue can occur if the highlighted code executes. See related events 3 and 4. Show: All events | Only primary events |
|
| |