(/home/sate/Testcases/c/cve/wireshark-1.2.0/dumpcap.c) |
| |
| 1558 | | | capture_loop_init_output(capture_options *capture_opts, int save_file_fd, loop_data *ld, char *errmsg, int errmsg_len) { |
| 1559 | | | int err; |
| 1560 | | | |
| 1561 | | | |
| 1562 | | | g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG, "capture_loop_init_output");
x /home/sate/Testcases/c/cve/wireshark-1.2.0/log.h |
| |
32 | #define LOG_DOMAIN_CAPTURE_CHILD "CaptureChild" |
| |
|
| 1563 | | | |
| 1564 | | | |
| 1565 | | | if (ld->from_cap_pipe) { |
Event 2:
Taking true branch. ld->from_cap_pipe evaluates to true.
hide
|
|
| 1566 | | | ld->file_snaplen = ld->cap_pipe_hdr.snaplen; |
| 1567 | | | } else |
| 1568 | | | { |
| 1569 | | | ld->file_snaplen = pcap_snapshot(ld->pcap_h); |
| 1570 | | | } |
| 1571 | | | |
| 1572 | | | |
| 1573 | | | if (capture_opts->multi_files_on) { |
Event 3:
Taking true branch. capture_opts->multi_files_on evaluates to true.
hide
|
|
| 1574 | [+] | | ld->pdh = ringbuf_init_libpcap_fdopen(&err); |
 |
| 1575 | | | } else { |
| 1576 | | | ld->pdh = libpcap_fdopen(save_file_fd, &err); |
| 1577 | | | } |
| 1578 | | | if (ld->pdh) { |
Event 11:
Taking true branch. ld->pdh evaluates to true.
hide
|
|
| 1579 | | | gboolean successful; |
| 1580 | | | |
| 1581 | | | ld->bytes_written = 0; |
| 1582 | | | if (capture_opts->use_pcapng) { |
Event 12:
Taking true branch. capture_opts->use_pcapng evaluates to true.
hide
|
|
| 1583 | | | char appname[100]; |
| 1584 | | | |
| 1585 | | | g_snprintf(appname, sizeof(appname), "Dumpcap " VERSION "%s", wireshark_svnversion); |
| 1586 | [+] | | successful = (ld->pdh, appname, &ld->bytes_written, &err) && |
Event 14:
ld->pdh, which evaluates to fdopen(fd, "wb") from pcapio.c:198, is passed to () as the first argument. See related event 10.
hide
|
|
 |
| 1587 | | | libpcap_write_interface_description_block(ld->pdh, capture_opts->iface, capture_opts->cfilter, ld->linktype, ld->file_snaplen, &ld->bytes_written, &err); |
| 1588 | | | } else { |
| 1589 | | | successful = (ld->pdh, ld->linktype, ld->file_snaplen, |
| 1590 | | | &ld->bytes_written, &err); |
| 1591 | | | } |
| 1592 | | | if (!successful) { |
Event 22:
Taking true branch. successful evaluates to false.
hide
|
|
| 1593 | | | fclose(ld->pdh); |
Event 23:
ld->pdh, which evaluates to fdopen(fd, "wb") from pcapio.c:198, is passed to fclose(). See related event 10.
hide
Double Close
ld->pdh was closed at pcapio.c:294 and is closed again here by fclose(). The issue can occur if the highlighted code executes. See related events 20 and 23. Show: All events | Only primary events |
|
| |