diff options
Diffstat (limited to 'lib/supplemental.c')
-rw-r--r-- | lib/supplemental.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/supplemental.c b/lib/supplemental.c index fc9545526a..becb01e50c 100644 --- a/lib/supplemental.c +++ b/lib/supplemental.c @@ -48,6 +48,7 @@ #include "supplemental.h" #include "errors.h" #include "num.h" +#include "intprops.h" typedef struct gnutls_supplemental_entry_st { char *name; @@ -252,6 +253,10 @@ _gnutls_supplemental_register(gnutls_supplemental_entry_st *entry) return gnutls_assert_val(GNUTLS_E_ALREADY_REGISTERED); } + if (unlikely(INT_ADD_OVERFLOW(suppfunc_size, 1))) { + return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR); + } + p = _gnutls_reallocarray_fast(suppfunc, suppfunc_size + 1, sizeof(*suppfunc)); if (!p) { |