Fixed string size calculation in winpr_HexDump

This commit is contained in:
Armin Novak 2014-09-11 13:59:48 +02:00
parent db52eb1456
commit 38d110da03

View File

@ -38,7 +38,7 @@ void winpr_HexDump(const char* tag, int level, const BYTE* data, int length)
const BYTE* p = data; const BYTE* p = data;
int i, line, offset = 0; int i, line, offset = 0;
const size_t llen = (length > WINPR_HEXDUMP_LINE_LENGTH) ? WINPR_HEXDUMP_LINE_LENGTH : length; const size_t llen = (length > WINPR_HEXDUMP_LINE_LENGTH) ? WINPR_HEXDUMP_LINE_LENGTH : length;
size_t blen = 5 + llen * 5; size_t blen = 7 + WINPR_HEXDUMP_LINE_LENGTH * 5;
size_t pos = 0; size_t pos = 0;
char* buffer = malloc(blen); char* buffer = malloc(blen);