]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: doveadm-sis - Ensure buf2 is not overrun
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 23 Jan 2020 07:57:26 +0000 (09:57 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 5 Feb 2020 12:10:32 +0000 (12:10 +0000)
Satisfies static analysers.

src/doveadm/doveadm-sis.c

index e681b8fde095803a315391d9a21b5f7d3eea1653..bc6444ebfa4c33c23e36fae9ef9f291140725b2d 100644 (file)
@@ -65,6 +65,7 @@ file_contents_equal(const char *path1, const char *path2, ino_t *path2_inode_r)
                int ret2;
 
                while ((ret1 = read(fd1, buf1, sizeof(buf1))) > 0) {
+                       i_assert((size_t)ret1 <= sizeof(buf2));
                        if ((ret2 = read_full(fd2, buf2, ret1)) <= 0) {
                                if (ret2 < 0)
                                        i_error("read(%s) failed: %m", path2);