Fixed string size calculation in winpr_HexDump
authorArmin Novak <armin.novak@thincast.com>
Thu, 11 Sep 2014 11:59:48 +0000 (13:59 +0200)
committerArmin Novak <armin.novak@thincast.com>
Thu, 11 Sep 2014 11:59:48 +0000 (13:59 +0200)
winpr/libwinpr/utils/print.c

index 62d9cc9..c8cd7a4 100644 (file)
@@ -38,7 +38,7 @@ void winpr_HexDump(const char* tag, int level, const BYTE* data, int length)
        const BYTE* p = data;
        int i, line, offset = 0;
        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;
        char* buffer = malloc(blen);