(/home/sate/Testcases/c/cve/wireshark-1.2.0/wiretap/commview.c) |
| |
| 317 | | | static gboolean commview_dump(wtap_dumper *wdh, |
| 318 | | | const struct wtap_pkthdr *phdr, |
| 319 | | | const union *, |
| 320 | | | const guchar *pd, int *err) |
| 321 | | | { |
| 322 | | | cv_hdr; |
| 323 | | | size_t bytes_written = 0; |
| 324 | | | char date_time[5]; |
| 325 | | | |
| 326 | | | memset(&cv_hdr, 0, sizeof(cv_hdr)); |
| 327 | | | |
| 328 | | | cv_hdr.data_len = GUINT16_TO_LE((guint16)phdr->caplen); |
| 329 | | | cv_hdr.source_data_len = GUINT16_TO_LE((guint16)phdr->caplen); |
| 330 | | | cv_hdr.version = 0; |
| 331 | | | |
| 332 | | | strftime(date_time, 5, "%Y", localtime(&phdr->ts.secs)); |
Event 1:
strftime() does not initialize date_time. - This may be because of a failure case or other special case for strftime(). Consult the strftime() documentation for more information.
hide
|
|
| 333 | | | cv_hdr.year = GUINT16_TO_LE((guint16)strtol(date_time, NULL, 10)); |
Event 2:
strtol() does not initialize date_time. - This may be because of a failure case or other special case for strtol(). Consult the strtol() documentation for more information.
hide
|
|
| 334 | | | |
| 335 | | | strftime(date_time, 5, "%m", localtime(&phdr->ts.secs)); |
Event 3:
strftime() does not initialize date_time. - This may be because of a failure case or other special case for strftime(). Consult the strftime() documentation for more information.
hide
|
|
| 336 | | | cv_hdr.month = (guint8)strtol(date_time, NULL, 10); |
Event 4:
strtol() does not initialize date_time. - This may be because of a failure case or other special case for strtol(). Consult the strtol() documentation for more information.
hide
|
|
| 337 | | | |
| 338 | | | strftime(date_time, 5, "%d", localtime(&phdr->ts.secs)); |
Event 5:
strftime() does not initialize date_time. - This may be because of a failure case or other special case for strftime(). Consult the strftime() documentation for more information.
hide
|
|
| 339 | | | cv_hdr.day = (guint8)strtol(date_time, NULL, 10); |
Event 6:
date_time is passed to strtol() as the first argument.
hide
Uninitialized Variable
*date_time was not initialized, but is used inside strtol(). The issue can occur if the highlighted code executes. See related events 1, 2, 3, 4, 5, and 6. Show: All events | Only primary events |
|
| |