GNUTLS_TL_VERIFY_CRL, 0));
cert = malloc(sizeof(*cert) * cert_chain_length);
+ assert(cert != NULL);
/* Import all the certificates in the chain to
* native certificate format.
bufNew (ssize_t size, ssize_t hwm)
{
buffer_t *b = calloc (1, sizeof (buffer_t));
+ if (!b) return NULL;
+
b->buf = calloc (1, size);
b->size = size;
b->hwm = hwm;
#define MAX_ENTRIES 128
#define MAX_POLICIES 8
+#define CHECK_MALLOC(x) \
+ if (x == NULL) { \
+ fprintf(stderr, "memory error\n"); \
+ exit(1); \
+ }
+
#define PRINT_TIME_T_ERROR \
if (sizeof(time_t) < 8) \
fprintf(stderr, "This system expresses time with a 32-bit time_t; that prevents dates after 2038 to be expressed by GnuTLS.\n")
if (s_name == NULL) { \
i = 0; \
s_name = malloc(sizeof(char*)*MAX_ENTRIES); \
+ CHECK_MALLOC(s_name); \
do { \
if (val && strcmp(val->pzName, name)!=0) \
continue; \
if (s_name == NULL) { \
i = 0; \
s_name = malloc(sizeof(char*)*MAX_ENTRIES); \
+ CHECK_MALLOC(s_name); \
do { \
if (val && strcmp(val->pzName, name)!=0) \
continue; \
str = strdup(val->v.strVal); \
+ CHECK_MALLOC(str); \
if ((p=strchr(str, ' ')) == NULL && (p=strchr(str, '\t')) == NULL) { \
fprintf(stderr, "Error parsing %s\n", name); \
exit(1); \