Received: by mail.netbsd.org (Postfix, from userid 605) id 8B5CB84D58; Mon, 7 Sep 2020 23:46:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 11F7484D3C for ; Mon, 7 Sep 2020 23:46:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id Kj9YYM4lC8YC for ; Mon, 7 Sep 2020 23:46:42 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 817EF84CCD for ; Mon, 7 Sep 2020 23:46:42 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 3DD40FB28; Mon, 7 Sep 2020 23:46:42 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1599522402219020" MIME-Version: 1.0 Date: Mon, 7 Sep 2020 23:46:42 +0000 From: "Thomas Klausner" Subject: CVS commit: pkgsrc/pkgtools/pkg_install/files/lib To: pkgsrc-changes@NetBSD.org Reply-To: wiz@netbsd.org X-Mailer: log_accum Message-Id: <20200907234642.3DD40FB28@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1599522402219020 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: wiz Date: Mon Sep 7 23:46:42 UTC 2020 Modified Files: pkgsrc/pkgtools/pkg_install/files/lib: plist.c Log Message: pkg_install: carry over a commit from the src tree Module Name: src Committed By: christos Date: Mon Sep 7 00:36:53 UTC 2020 Modified Files: src/external/bsd/pkg_install/dist/lib: plist.c Log Message: Avoid strict aliasing issue by using a separate buffer.. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pkg_install/dist/lib/plist.c To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 pkgsrc/pkgtools/pkg_install/files/lib/plist.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1599522402219020 Content-Disposition: inline Content-Length: 1695 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/pkgtools/pkg_install/files/lib/plist.c diff -u pkgsrc/pkgtools/pkg_install/files/lib/plist.c:1.30 pkgsrc/pkgtools/pkg_install/files/lib/plist.c:1.31 --- pkgsrc/pkgtools/pkg_install/files/lib/plist.c:1.30 Sun Mar 1 11:02:04 2020 +++ pkgsrc/pkgtools/pkg_install/files/lib/plist.c Mon Sep 7 23:46:42 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: plist.c,v 1.30 2020/03/01 11:02:04 rillig Exp $ */ +/* $NetBSD: plist.c,v 1.31 2020/09/07 23:46:42 wiz Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -7,7 +7,7 @@ #if HAVE_SYS_CDEFS_H #include #endif -__RCSID("$NetBSD: plist.c,v 1.30 2020/03/01 11:02:04 rillig Exp $"); +__RCSID("$NetBSD: plist.c,v 1.31 2020/09/07 23:46:42 wiz Exp $"); /* * FreeBSD install - a package for the installation and maintainance @@ -627,8 +627,10 @@ delete_package(Boolean ign_err, package_ } buf[SymlinkHeaderLen + cc] = 0x0; if (strcmp(buf, p->next->name) != 0) { - if ((cc = readlink(&buf[SymlinkHeaderLen], &buf[SymlinkHeaderLen], - sizeof(buf) - SymlinkHeaderLen)) < 0) { + char tmp2[MaxPathSize]; + + if ((cc = readlink(&buf[SymlinkHeaderLen], tmp2, + sizeof(tmp2))) < 0) { printf("symlink %s is not same as recorded value, %s: %s\n", buf, Force ? "deleting anyway" : "not deleting", tmp); if (!Force) { @@ -636,6 +638,7 @@ delete_package(Boolean ign_err, package_ goto pkgdb_cleanup; } } + memcpy(&buf[SymlinkHeaderLen], tmp2, cc); buf[SymlinkHeaderLen + cc] = 0x0; if (strcmp(buf, p->next->name) != 0) { printf("symlink %s is not same as recorded value, %s: %s\n", --_----------=_1599522402219020--