pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/55865: pkg_add segfaults

>Number:         55865
>Category:       pkg
>Synopsis:       pkg_add segfaults
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 12 08:50:01 +0000 2020
>Originator:     Michael van Elst
>Release:        NetBSD 9.99.76
System: NetBSD tazz 9.99.76 NetBSD 9.99.76 (GENERIC) #4: Sun Dec 6 14:41:55 UTC 2020 mlelstv@slowpoke:/scratch2/obj.amd64/scratch/netbsd-current/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
Installing a package with a dependency that doesn't exist in the repository causes a segfault.

The check_dependencies() function includes:

	best_installed = find_best_matching_installed_pkg(p->name, 0);

	for (i = 0; i < pkg->dep_length; ++i) {
		if (strcmp(best_installed, pkg->dependencies[i]) == 0)
	pkg->dependencies[pkg->dep_length++] = best_installed;

where best_installed can be NULL and so can pkg->dependencies[i] later.

The previous handling of NULL results was dropped in the last change
to perform.c.

pkg_add ./rsync-3.2.3.tgz
pkg_add: Warning: package `rsync-3.2.3' was built for a platform:
pkg_add: NetBSD/x86_64 9.0 (pkg) vs. NetBSD/x86_64 9.99.76 (this host)
pkg_add: no pkg found for 'bash-[0-9]*', sorry.
pkg_add: Can't install dependency bash-[0-9]*
Segmentation fault (core dumped)


Home | Main Index | Thread Index | Old Index