From owner-dev-commits-src-all@freebsd.org Tue Dec 29 23:06:44 2020 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F025A4CD7BA; Tue, 29 Dec 2020 23:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D595w6X9fz3mWD; Tue, 29 Dec 2020 23:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D39461421E; Tue, 29 Dec 2020 23:06:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BTN6ieP093342; Tue, 29 Dec 2020 23:06:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BTN6i9k093341; Tue, 29 Dec 2020 23:06:44 GMT (envelope-from git) Date: Tue, 29 Dec 2020 23:06:44 GMT Message-Id: <202012292306.0BTN6i9k093341@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ryan Libby Subject: git: 62a77bb7edb2 - stable/12 - [libsa] Fix typecast of pointer for st_dev MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 62a77bb7edb28d572c8642edce974631037119bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for all branches of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2020 23:06:45 -0000 The branch stable/12 has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=62a77bb7edb28d572c8642edce974631037119bb commit 62a77bb7edb28d572c8642edce974631037119bb Author: Adrian Chadd AuthorDate: 2020-04-16 23:29:49 +0000 Commit: Ryan Libby CommitDate: 2020-12-29 23:04:40 +0000 [libsa] Fix typecast of pointer for st_dev This code was trying to use a pointer value for st_dev, which is definitely not a pointer. Instead, cast to uintptr_t so it becomes a non-pointer value before casting it. Tested: mips-gcc cross compile, mips32 build (cherry picked from commit 6c88ef1c81fce18d6545c4ee8d0df32a25098770) --- stand/libsa/pkgfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/libsa/pkgfs.c b/stand/libsa/pkgfs.c index d4794963b2c1..4f52b6bb6b9b 100644 --- a/stand/libsa/pkgfs.c +++ b/stand/libsa/pkgfs.c @@ -399,7 +399,7 @@ pkg_stat(struct open_file *f, struct stat *sb) sb->st_size = tf->tf_size; sb->st_blocks = (tf->tf_size + 511) / 512; sb->st_mtime = pkg_atol(tf->tf_hdr.ut_mtime, 12); - sb->st_dev = (off_t)tf->tf_pkg; + sb->st_dev = (off_t)((uintptr_t)tf->tf_pkg); sb->st_ino = tf->tf_ofs; /* unique per tf_pkg */ return (0); }