Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Merge pull request #1315 from DarkHelmet433/master
Baptiste Daroussin committed 10 years ago
commit 41888765e13a6a3a0c1a53b5cffd78e6e2e27eda
parent 066fb7a
1 file changed +2 -1
modified libpkg/pkg_add.c
@@ -216,8 +216,9 @@ do_extract(struct archive *a, struct archive_entry *ae, const char *location,
		if (pkg_is_config_file(pkg, path, &rf, &rcf)) {
			pkg_debug(1, "Populating config_file %s", pathname);
			size_t len = archive_entry_size(ae);
-
			rcf->content = malloc(len);
+
			rcf->content = malloc(len + 1);
			archive_read_data(a, rcf->content, len);
+
			rcf->content[len] = '\0';
			if (renamed && (!automerge || local == NULL))
				strlcat(pathname, ".pkgnew", sizeof(pathname));
		}