• Christophe Fergeau's avatar
    hex_dump: Fix buffer overflow · 3031bdbd
    Christophe Fergeau authored
    When printing the hexdump output, the hex_dump() function prints 5
    visible chars at a time, but since it's using sprintf, it will also
    print a '\0'. Since its output string are sized to be 5*number_of_chars,
    this means we will overflow the output string by one character on the
    last iteration. This commit ensures the output strings are properly
    sized to avoid this.
    Signed-off-by: 's avatarChristophe Fergeau <cfergeau@redhat.com>
    3031bdbd