#include <fips.h>
#include "crypto-api.h"
#include "iov.h"
+#include "intprops.h"
typedef struct api_cipher_hd_st {
cipher_hd_st ctx_enc;
{
void *data;
+ if (INT_ADD_OVERFLOW(s->size, length)) {
+ return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
+ }
s->size += length;
data = gnutls_realloc(s->data, s->size);
if (data == NULL)
uint8_t *p;
dst->size = 0;
- for (i=0;i<iovcnt;i++)
+ for (i=0;i<iovcnt;i++) {
+ if (INT_ADD_OVERFLOW(dst->size, iov[i].iov_len)) {
+ return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
+ }
dst->size += iov[i].iov_len;
+ }
dst->data = gnutls_malloc(dst->size);
if (dst->data == NULL)
return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR);