diff options
author | wiz <wiz@pkgsrc.org> | 2020-09-07 23:46:42 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2020-09-07 23:46:42 +0000 |
commit | a6dc07a77442a4e36a90c199fdc93657af6a5411 (patch) | |
tree | d5aa728227bf89f5d4ab75c87c8e338acc6bd644 /pkgtools/pkg_install | |
parent | be8f1144100b83071ca4603df7f167f7b81065d7 (diff) | |
download | pkgsrc-a6dc07a77442a4e36a90c199fdc93657af6a5411.tar.gz |
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
Diffstat (limited to 'pkgtools/pkg_install')
-rw-r--r-- | pkgtools/pkg_install/files/lib/plist.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pkgtools/pkg_install/files/lib/plist.c b/pkgtools/pkg_install/files/lib/plist.c index 9cc9695c7ba..4dc99ae7188 100644 --- a/pkgtools/pkg_install/files/lib/plist.c +++ b/pkgtools/pkg_install/files/lib/plist.c @@ -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 <sys/cdefs.h> #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_t *pkg, Boolean NoDeleteFiles, } 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_t *pkg, Boolean NoDeleteFiles, 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", |