]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
_gnutls_hex2bin: avoid overrun in the provided buffer
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 14 Sep 2015 19:32:05 +0000 (21:32 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 14 Sep 2015 19:32:05 +0000 (21:32 +0200)
lib/str.c

index 6b5f49ca8961bf629131054fa5a8d355085bee9b..7a04c789858bac528575f37a4c353f8a1138fcb4 100644 (file)
--- 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;
                }