ciscodump: check return value of libpcap_write_packet (CID: 1435606).

Change-Id: Ifb89952b48bf300168b5f775ac3c2777c0c93877
Reviewed-on: https://code.wireshark.org/review/27803
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Dario Lombardo 2018-05-25 15:53:04 +02:00 committed by Anders Broman
parent 089368f97e
commit 7f4c2bae5c
1 changed files with 5 additions and 1 deletions

View File

@ -249,7 +249,11 @@ static void ssh_loop_read(ssh_channel channel, FILE* fp, const guint32 count)
if (status == CISCODUMP_PARSER_END_PACKET) {
/* dump the packet to the pcap file */
libpcap_write_packet(fp, curtime, (guint32)(curtime / 1000), packet_size, packet_size, packet, &bytes_written, &err);
if (!libpcap_write_packet(fp, curtime, (guint32)(curtime / 1000), packet_size,
packet_size, packet, &bytes_written, &err)) {
g_debug("Error in libpcap_write_packet(): %s", g_strerror(err));
break;
}
g_debug("Dumped packet %lu size: %u", packets, packet_size);
packet_size = 0;
status = CISCODUMP_PARSER_STARTING;