summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2020-12-12 19:25:19 +0000
committerwiz <wiz@pkgsrc.org>2020-12-12 19:25:19 +0000
commit2fcb6993513c1b3c71fc487d0c72fe3d72094fab (patch)
treed263ce878b99e49ba7401bf435048f28d1eb100d /pkgtools
parent6347ffa789b5c82d51a8cf4601512491ee02fc5d (diff)
downloadpkgsrc-2fcb6993513c1b3c71fc487d0c72fe3d72094fab.tar.gz
pkg_install: carry over bugfix from src
christos: Don't try to memcpy (size_t)-1 bytes!
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/lib/plist.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/pkgtools/pkg_install/files/lib/plist.c b/pkgtools/pkg_install/files/lib/plist.c
index 4dc99ae7188..3272d2aaa0c 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.31 2020/09/07 23:46:42 wiz Exp $ */
+/* $NetBSD: plist.c,v 1.32 2020/12/12 19:25:19 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.31 2020/09/07 23:46:42 wiz Exp $");
+__RCSID("$NetBSD: plist.c,v 1.32 2020/12/12 19:25:19 wiz Exp $");
/*
* FreeBSD install - a package for the installation and maintainance
@@ -637,15 +637,16 @@ delete_package(Boolean ign_err, package_t *pkg, Boolean NoDeleteFiles,
fail = FAIL;
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",
- buf, Force ? "deleting anyway" : "not deleting", tmp);
- if (!Force) {
- fail = FAIL;
- goto pkgdb_cleanup;
+ } else {
+ 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",
+ buf, Force ? "deleting anyway" : "not deleting", tmp);
+ if (!Force) {
+ fail = FAIL;
+ goto pkgdb_cleanup;
+ }
}
}
}