From: WanBingjiang Date: Mon, 2 Feb 2026 06:55:11 +0000 (+0800) Subject: hexdump: fixes Heap-buffer-overflow in rewrite_rules X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcc5161240fe3b5c993297880432e150ff124f3b;p=thirdparty%2Futil-linux.git hexdump: fixes Heap-buffer-overflow in rewrite_rules --- diff --git a/text-utils/hexdump-parse.c b/text-utils/hexdump-parse.c index efc39c3b3..9363b957d 100644 --- a/text-utils/hexdump-parse.c +++ b/text-utils/hexdump-parse.c @@ -358,14 +358,15 @@ isint: cs[3] = '\0'; FALLTHROUGH; case 'a': pr->flags = F_ADDRESS; - ++p2; - if (first_letter(p1 + 2, "dox")) { + if (p1[2] && first_letter(p1 + 2, "dox")) { + ++p2; cs[0] = 'l'; cs[1] = 'l'; cs[2] = p1[2]; cs[3] = '\0'; } else { - p1[3] = '\0'; + if (p1[2]) + p1[3] = '\0'; badconv(p1); } break;