Date: Wed, 1 Oct 2014 16:47:14 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r272374 - user/marcel/mkimg Message-ID: <201410011647.s91GlE1C085123@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marcel Date: Wed Oct 1 16:47:14 2014 New Revision: 272374 URL: https://svnweb.freebsd.org/changeset/base/272374 Log: Make sure to widen secsz from size_t to off_t when using it as a mask. On 32-bit machines this would other wise mask off the upper 32-bits of the 64-bit file offset. Modified: user/marcel/mkimg/image.c Modified: user/marcel/mkimg/image.c ============================================================================== --- user/marcel/mkimg/image.c Wed Oct 1 16:18:59 2014 (r272373) +++ user/marcel/mkimg/image.c Wed Oct 1 16:47:14 2014 (r272374) @@ -418,7 +418,7 @@ image_copyin_mapped(lba_t blk, int fd, u if (cur == hole && data > hole) { hole = pos; - pos = data & ~(secsz - 1); + pos = data & ~((uint64_t)secsz - 1); blk += (pos - hole) / secsz; error = image_chunk_skipto(blk); @@ -427,7 +427,7 @@ image_copyin_mapped(lba_t blk, int fd, u cur = data; } else if (cur == data && hole > data) { data = pos; - pos = (hole + secsz - 1) & ~(secsz - 1); + pos = (hole + secsz - 1) & ~((uint64_t)secsz - 1); while (data < pos) { sz = (pos - data > (off_t)iosz)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410011647.s91GlE1C085123>