[Reproducible-commits] [dpkg] 03/32: dpkg: Do not segfault on “dpkg -i --no-act”
Holger Levsen
holger at layer-acht.org
Tue May 3 08:43:12 UTC 2016
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to annotated tag 1.15.10
in repository dpkg.
commit 420c62ccbf88e7c961e586946eb1464e9ede2a31
Author: Guillem Jover <guillem at debian.org>
Date: Fri Feb 4 18:59:00 2011 +0100
dpkg: Do not segfault on “dpkg -i --no-act”
Cherry picked from commit da5fceca72b4c67be8acdb0734dbf7c241519dff.
mkdtemp() takes the string allocated by path_make_temp_template() and
modifies it, but there's not enough allocated room for the subsequent
string appends done starting from cidirrest, for the control files.
Regression introduced in commit ffccc65580189420a0a64736bba0fb661de56dcb.
---
debian/changelog | 1 +
src/processarc.c | 11 +++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 852be90..0bd3b0e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ dpkg (1.15.8.11) UNRELEASED; urgency=low
[ Guillem Jover ]
* Fix build failure when passing --disable-nls to configure.
+ * Do not segfault on “dpkg -i --no-act”.
[ Updated man page translations ]
* German (Helge Kreutzmann). Minor fixe(s).
diff --git a/src/processarc.c b/src/processarc.c
index e2d2a30..0b33b25 100644
--- a/src/processarc.c
+++ b/src/processarc.c
@@ -193,14 +193,21 @@ void process_archive(const char *filename) {
if (f_noact) {
+ char *tmpdir;
+
if (!cidirbuf)
free(cidirbuf);
- cidir = cidirbuf = mkdtemp(path_make_temp_template("dpkg"));
- if (!cidir)
+ tmpdir = mkdtemp(path_make_temp_template("dpkg"));
+ if (!tmpdir)
ohshite(_("unable to create temporary directory"));
+
+ cidir = cidirbuf = m_malloc(strlen(tmpdir) + MAXCONTROLFILENAME + 10);
+ strcpy(cidir, tmpdir);
strcat(cidir,"/");
cidirrest = cidir + strlen(cidir);
+
+ free(tmpdir);
} else {
/* We want it to be on the same filesystem so that we can
* use rename(2) to install the postinst &c.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list