aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-03-27 18:54:49 -0400
committerMichael Mann <mmann78@netscape.net>2017-03-28 01:09:13 +0000
commit4038b2db268ab967f4e7da483aef5573f5f31155 (patch)
tree671d539ba6a78d30ccd095feaf78a83a82f0487d /rawshark.c
parent915d3409944caef5f452a6c59d4abe89c06ea898 (diff)
rawshark: Move large data (WTAP_MAX_PACKET_SIZE) to the heap.
Change-Id: Ib525d35b6a0fa58602d30fda701b0cce5f05b322 Reviewed-on: https://code.wireshark.org/review/20756 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'rawshark.c')
-rw-r--r--rawshark.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rawshark.c b/rawshark.c
index 032ee93a7c..ea53183b56 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -1031,7 +1031,7 @@ load_cap_file(capture_file *cf)
gchar *err_info = NULL;
gint64 data_offset = 0;
- guchar pd[WTAP_MAX_PACKET_SIZE];
+ guchar *pd;
struct wtap_pkthdr phdr;
epan_dissect_t edt;
@@ -1039,6 +1039,7 @@ load_cap_file(capture_file *cf)
epan_dissect_init(&edt, cf->epan, TRUE, FALSE);
+ pd = (guchar*)g_malloc(WTAP_MAX_PACKET_SIZE);
while (raw_pipe_read(&phdr, pd, &err, &err_info, &data_offset)) {
process_packet(cf, &edt, data_offset, &phdr, pd);
}
@@ -1046,7 +1047,7 @@ load_cap_file(capture_file *cf)
epan_dissect_cleanup(&edt);
wtap_phdr_cleanup(&phdr);
-
+ g_free(pd);
if (err != 0) {
/* Print a message noting that the read failed somewhere along the line. */
switch (err) {