X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=lib%2Fhexdump.c;h=992457b1284c186d8e0d7b8c5d7b5fc349c18ef3;hb=015a2f823e49927e0da4361a7dfadf0aae33146b;hp=8d74c20d8595c76d3882fcc02a7fa00f8db1bfaa;hpb=ab5c342992cac7d1ddaf8a75a4dcab0d13718022;p=mirror_ubuntu-artful-kernel.git diff --git a/lib/hexdump.c b/lib/hexdump.c index 8d74c20d8595..992457b1284c 100644 --- a/lib/hexdump.c +++ b/lib/hexdump.c @@ -169,11 +169,15 @@ int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, } } else { for (j = 0; j < len; j++) { - if (linebuflen < lx + 3) + if (linebuflen < lx + 2) goto overflow2; ch = ptr[j]; linebuf[lx++] = hex_asc_hi(ch); + if (linebuflen < lx + 2) + goto overflow2; linebuf[lx++] = hex_asc_lo(ch); + if (linebuflen < lx + 2) + goto overflow2; linebuf[lx++] = ' '; } if (j)