From f0159b2fd289e5ee10f40184d92f25ae16a79f91 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Tue, 19 May 2020 13:50:24 +0200 Subject: [PATCH] util: PrintRawDataFp handles null for gaps which are data=NULL and len>0 --- src/util-print.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util-print.c b/src/util-print.c index f9db2cae1b..fadd4e2fbf 100644 --- a/src/util-print.c +++ b/src/util-print.c @@ -143,6 +143,10 @@ void PrintRawDataFp(FILE *fp, const uint8_t *buf, uint32_t buflen) int ch = 0; uint32_t u = 0; + if (buf == NULL) { + fprintf(fp, " (null)\n"); + return; + } for (u = 0; u < buflen; u+=16) { fprintf(fp ," %04X ", u); for (ch = 0; (u+ch) < buflen && ch < 16; ch++) { -- 2.47.2