diff --git a/src/extract.c b/src/extract.c index 8be05033..4488baae 100644 --- a/src/extract.c +++ b/src/extract.c @@ -164,7 +164,7 @@ int extract_tnef(struct session_data *sdata, struct parser_state *state, char *f struct dirent **namelist; memset(tmpdir, 0, sizeof(tmpdir)); - make_random_string(&tmpdir[0], sizeof(tmpdir)-3); + make_random_string((unsigned char *)&tmpdir[0], sizeof(tmpdir)-3); memcpy(&tmpdir[sizeof(tmpdir)-3], ".d", 2); diff --git a/src/misc.c b/src/misc.c index ec961133..89a72a17 100644 --- a/src/misc.c +++ b/src/misc.c @@ -269,19 +269,18 @@ int extractEmail(char *rawmail, char *email){ * using the rand() function if not possible */ -void make_random_string(char *buf, int buflen){ +void make_random_string(unsigned char *buf, int buflen){ int i, len, fd; int urandom=0; static char alphanum[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - unsigned char s[QUEUE_ID_LEN]; len = strlen(alphanum); fd = open(RANDOM_POOL, O_RDONLY); if(fd != -1){ - if(readFromEntropyPool(fd, s, sizeof(s)) == sizeof(s)){ - for(i=0; ittmpfile[0]), 0, SMALLBUFSIZE); - make_random_string(&(session->ttmpfile[0]), QUEUE_ID_LEN); + make_random_string((unsigned char*)&(session->ttmpfile[0]), QUEUE_ID_LEN); session->protocol_state = SMTP_STATE_MAIL_FROM; extractEmail(buf, session->mailfrom);