aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2012-03-19 02:00:42 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2012-03-19 02:00:42 +0000
commita94c84d34f3770037047e80d3fe1c047d3960016 (patch)
tree128958c70d4a42ba9c5c046387b5538f77a86950 /epan
parent13e113bd44573ac03ba9ded673eeda25c418348e (diff)
Add a new environment variable (WIRESHARK_ABORT_ON_OUT_OF_MEMORY) that
prevents OutOfMemory exceptions from being thrown. This makes it easier to debug such conditions. Set this variable in test-fuzzed-cap.sh but not in fuzz-test.sh; it's nice to see the friendly out-of-memory error message in the bug reports the latter script generates. svn path=/trunk/; revision=41656
Diffstat (limited to 'epan')
-rw-r--r--epan/emem.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/epan/emem.c b/epan/emem.c
index 29f1e2960d..0e5478efcc 100644
--- a/epan/emem.c
+++ b/epan/emem.c
@@ -640,7 +640,10 @@ emem_create_chunk(size_t size)
if (npc->buf == NULL) {
g_free(npc);
- THROW(OutOfMemoryError);
+ if (getenv("WIRESHARK_ABORT_ON_OUT_OF_MEMORY"))
+ abort();
+ else
+ THROW(OutOfMemoryError);
}
#elif defined(USE_GUARD_PAGES)
@@ -649,7 +652,10 @@ emem_create_chunk(size_t size)
if (npc->buf == MAP_FAILED) {
g_free(npc);
- THROW(OutOfMemoryError);
+ if (getenv("WIRESHARK_ABORT_ON_OUT_OF_MEMORY"))
+ abort();
+ else
+ THROW(OutOfMemoryError);
}
#else /* Is there a draft in here? */