NetBSDfr / pkgin

pkgin's official github repository
130 stars 40 forks source link

Initialize downloadhead in pkgin_install #105

Closed snowkat closed 3 years ago

snowkat commented 3 years ago

When cancelling out of an attempted install with conflicts, pkgin_install jumps to installend before downloadhead has a chance to be initialized. This causes a segfault within free_pkglist (at least, in NetBSD 9.99.73) as the lists are being cleaned up. Example:

# pkgin install rust
calculating dependencies...done.
rust-1.45.2nb2 (to be installed) conflicts with installed package rust-bin-1.46.0.
proceed ? [y/N] n
Memory fault (core dumped)

Initializing downloadhead as NULL at the start of pkgin_install resolves this.

jperkin commented 3 years ago

Thanks! I hadn't tested that case, it's now covered in the test suite.