From 4dc66b9cb0ee809c1dd4c66640878a232aacf22d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Aug 2011 20:00:18 -0700 Subject: [PATCH] gatchat: Abort hexdump helper when no debug function is specified --- gatchat/gatutil.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gatchat/gatutil.c b/gatchat/gatutil.c index 768490b2..6a7bb4b6 100644 --- a/gatchat/gatutil.c +++ b/gatchat/gatutil.c @@ -140,6 +140,9 @@ void g_at_util_debug_hexdump(gboolean in, const unsigned char *buf, gsize len, char str[68]; gsize i; + if (debugf == NULL || !len) + return; + str[0] = in ? '<' : '>'; for (i = 0; i < len; i++) {