From: Nikos Mavrogiannopoulos Date: Mon, 14 Sep 2015 19:32:05 +0000 (+0200) Subject: _gnutls_hex2bin: avoid overrun in the provided buffer X-Git-Tag: gnutls_3_5_0~672 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1788b331d6a1af2a16d001fa5dc111c4f0a144e2;p=thirdparty%2Fgnutls.git _gnutls_hex2bin: avoid overrun in the provided buffer --- diff --git a/lib/str.c b/lib/str.c index 6b5f49ca89..7a04c78985 100644 --- a/lib/str.c +++ b/lib/str.c @@ -508,8 +508,7 @@ _gnutls_hex2bin(const char *hex_data, size_t hex_size, uint8_t * bin_data, i++; continue; } - - if (j > *bin_size) { + if (j >= *bin_size) { gnutls_assert(); return GNUTLS_E_SHORT_MEMORY_BUFFER; }