[dpkg] 117/187: libdpkg: Only set error context message if it has been formatted correctly
Reiner Herrmann
reiner at reiner-h.de
Sun Nov 6 12:46:31 UTC 2016
This is an automated email from the git hooks/post-receive script.
deki-guest pushed a commit to branch master
in repository dpkg.
commit 1d1c70fed17c17ef11e167b5c68825239659777b
Author: Guillem Jover <guillem at debian.org>
Date: Wed Aug 10 20:39:39 2016 +0200
libdpkg: Only set error context message if it has been formatted correctly
We should not be adding junk to the error context message.
---
debian/changelog | 2 ++
lib/dpkg/ehandle.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 9455a57..3f20ad4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,6 +32,8 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
standalone, by honoring SOURCE_DATE_EPOCH.
* Fix several short-lived memory leaks in update-alternatives.
Reported by Helmut Grohne <helmut at subdivi.de>.
+ * Only set the error context message in libdpkg if it has been formatted
+ correctly.
* Architecture support:
- Add support for AIX operating system.
* Portability:
diff --git a/lib/dpkg/ehandle.c b/lib/dpkg/ehandle.c
index 3a063f6..517b073 100644
--- a/lib/dpkg/ehandle.c
+++ b/lib/dpkg/ehandle.c
@@ -195,7 +195,8 @@ error_context_errmsg_format(const char *fmt, va_list args)
/* If the message was constructed successfully, at least we have some
* error message, which is better than nothing. */
- error_context_errmsg_set(econtext, errmsg);
+ if (rc >= 0)
+ error_context_errmsg_set(econtext, errmsg);
if (rc < 0) {
/* If there was any error, just use the emergency error message buffer,
--
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