Commit 204479c8 authored by Kees Cook's avatar Kees Cook

Properly restore addresses from hcache using rfc822_new_address(). Closes #3302.

parent fdb0b466
......@@ -45,6 +45,7 @@
#include "mx.h"
#include "lib.h"
#include "md5.h"
#include "rfc822.h"
#if HAVE_QDBM
static struct header_cache
......@@ -231,7 +232,7 @@ restore_address(ADDRESS ** a, const unsigned char *d, int *off, int convert)
while (counter)
{
*a = safe_malloc(sizeof (ADDRESS));
*a = rfc822_new_address();
#ifdef EXACT_ADDRESS
restore_char(&(*a)->val, d, off, convert);
#endif
......
......@@ -19,6 +19,8 @@
#ifndef rfc822_h
#define rfc822_h
#include "lib.h"
/* possible values for RFC822Error */
enum
{
......@@ -60,6 +62,6 @@ extern int RFC822Error;
extern const char *RFC822Errors[];
#define rfc822_error(x) RFC822Errors[x]
#define rfc822_new_address() calloc(1,sizeof(ADDRESS))
#define rfc822_new_address() safe_calloc(1,sizeof(ADDRESS))
#endif /* rfc822_h */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment