dovecot-2.2: doveadm dump log: Fixed potential crash when log he...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 16 12:48:55 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/b2e16f0e88db
changeset: 17498:b2e16f0e88db
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 16 15:47:12 2014 +0300
description:
doveadm dump log: Fixed potential crash when log header size was corrupted.

diffstat:

 src/doveadm/doveadm-dump-log.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (14 lines):

diff -r de20b4fa60ac -r b2e16f0e88db src/doveadm/doveadm-dump-log.c
--- a/src/doveadm/doveadm-dump-log.c	Mon Jun 16 15:42:39 2014 +0300
+++ b/src/doveadm/doveadm-dump-log.c	Mon Jun 16 15:47:12 2014 +0300
@@ -497,7 +497,9 @@
 	}
 	printf("\n");
 
-	if (hdr.size < 1024*1024) {
+	if (hdr.size < sizeof(hdr)) {
+		i_fatal("Invalid header size %u", hdr.size);
+	} else if (hdr.size < 1024*1024) {
 		unsigned char *buf = t_malloc(hdr.size);
 
 		ret = read(fd, buf, hdr.size - sizeof(hdr));


More information about the dovecot-cvs mailing list