summaryrefslogtreecommitdiff
path: root/zhm/queue.c
diff options
context:
space:
mode:
authorGravatar Greg Hudson <ghudson@mit.edu>1997-09-23 01:58:26 +0000
committerGravatar Greg Hudson <ghudson@mit.edu>1997-09-23 01:58:26 +0000
commit14b8946f493d3ac02c4468c57fd411b31c4c0894 (patch)
tree090afd2995bac6a250f6d5a0169743f3cc566227 /zhm/queue.c
parent00952bc3a6ffb87a25d5c492c62b3a6680841286 (diff)
From mhpower: avoid possible buffer overflows.
Diffstat (limited to 'zhm/queue.c')
-rw-r--r--zhm/queue.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/zhm/queue.c b/zhm/queue.c
index 5e0ca3a..70de938 100644
--- a/zhm/queue.c
+++ b/zhm/queue.c
@@ -68,8 +68,14 @@ Code_t add_notice_to_queue(notice, packet, repl, len)
DPR("Adding notice to queue...\n");
if (!find_notice_in_queue(notice)) {
entry = (Queue *) malloc(sizeof(Queue));
+ if (entry == NULL)
+ return(ZERR_NONOTICE);
entry->retries = 0;
entry->packet = (char *) malloc(Z_MAXPKTLEN);
+ if (entry->packet == NULL) {
+ free(entry);
+ return(ZERR_NONOTICE);
+ }
memcpy(entry->packet, packet, Z_MAXPKTLEN);
if (ZParseNotice(entry->packet, len, &entry->notice) != ZERR_NONE) {
syslog(LOG_ERR, "ZParseNotice failed, but succeeded before");