diff options
-rw-r--r-- | lib/Zinternal.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Zinternal.c b/lib/Zinternal.c index 9ad6bda..f63d069 100644 --- a/lib/Zinternal.c +++ b/lib/Zinternal.c @@ -369,6 +369,10 @@ Z_ReadWait(void) if (partof > Z_MAXNOTICESIZE) return (ZERR_NONE); + /* Ignore garbage at the end */ + if (notice.z_message_len > partof - part) + notice.z_message_len = partof - part; + /* * If we aren't a server and we can find a notice in the queue * with the same multiuid field, insert the current fragment as |