summaryrefslogtreecommitdiff
path: root/lib/Zinternal.c
diff options
context:
space:
mode:
authorGravatar Greg Hudson <ghudson@mit.edu>2002-09-10 12:04:29 +0000
committerGravatar Greg Hudson <ghudson@mit.edu>2002-09-10 12:04:29 +0000
commitb256f8f2f822f0c5667839addeb026af0b037c18 (patch)
tree2b3f3af9bbb13dc6433945227837a712ee3d5e1f /lib/Zinternal.c
parent5b7a43743c9f7b4cb29e40a1a07b4f468c7770c0 (diff)
Fix buffer overruns.
Diffstat (limited to 'lib/Zinternal.c')
-rw-r--r--lib/Zinternal.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Zinternal.c b/lib/Zinternal.c
index 9fb9a3f..1a3fcec 100644
--- a/lib/Zinternal.c
+++ b/lib/Zinternal.c
@@ -471,6 +471,11 @@ Code_t Z_AddNoticeToEntry(qptr, notice, part)
struct _Z_Hole *hole, *lasthole;
struct timeval tv;
+ /* Bounds check. */
+ if (part < 0 || notice->z_message_len < 0 || part > qptr->msg_len
+ || notice->z_message_len > qptr->msg_len - part)
+ return (ZERR_NONE);
+
/* Incorporate this notice's checked authentication. */
if (notice->z_checked_auth == ZAUTH_FAILED)
qptr->auth = ZAUTH_FAILED;