]> granicus.if.org Git - curl/commit
transfer.c: do not compute length of undefined hex buffer.
authorPatrick Monnerat <patrick@monnerat.net>
Thu, 14 Feb 2019 15:03:24 +0000 (16:03 +0100)
committerPatrick Monnerat <patrick@monnerat.net>
Thu, 14 Feb 2019 15:03:24 +0000 (16:03 +0100)
commit539d17b0de923b9a122f551fddac2a82ed95d9b2
treeb453dc9d85aefd1cebf3916cef262fad14a15d9c
parenta75de9de40b30231ca59d8058f11a73a08779dd3
transfer.c: do not compute length of undefined hex buffer.

On non-ascii platforms, the chunked hex header was measured for char code
conversion length, even for chunked trailers that do not have an hex header.
In addition, the efective length is already known: use it.
Since the hex length can be zero, only convert if needed.

Reported by valgrind.
lib/transfer.c