From 4003e6b8ae95e19b8bbfcb541b919315a6b885bf Mon Sep 17 00:00:00 2001 From: Riccardo Schirone Date: Tue, 23 Jun 2015 14:59:53 +0200 Subject: [PATCH] util/print: fix a heap overflow when len is not a multiple of step --- libr/util/print.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libr/util/print.c b/libr/util/print.c index 9f883d27dd..87674fa047 100644 --- a/libr/util/print.c +++ b/libr/util/print.c @@ -540,6 +540,7 @@ R_API void r_print_hexdump(RPrint *p, ut64 addr, const ut8 *buf, int len, int ba int last_sparse = 0; const char *a, *b; + len = len - (len % step); if (p) { pairs = p->pairs; use_sparse = p->flags & R_PRINT_FLAGS_SPARSE;