The following commit has been merged in the master branch:
commit 85ec281bf450af3db3b75fca51b5b3982ed9f434
Author: Guillem Jover <[email protected]>
Date: Fri Dec 21 19:51:53 2012 +0100
libdpkg: Do not use an undefined va_list variable in dpkg_put_errno()
The va_start()/va_end() pair are surrounding the wrong function. This
might cause bogus error messages on some systems, or crashes on some
others depending on the stdarg implementation.
diff --git a/debian/changelog b/debian/changelog
index 3ee1b32..087f3ea 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ dpkg (1.16.10) UNRELEASED; urgency=low
* Fix typos in 1.16.9 changelog entry. Closes: #691954
Thanks to Nicolás Alvarez <[email protected]>.
* Add missing @LIBLZMA_LIBS@ to Libs.Private in libdpkg.pc.in.
+ * Do not use an undefined va_list variable in dpkg_put_errno().
[ Updated programs translations ]
* Esperanto (Felipe Castro).
diff --git a/lib/dpkg/error.c b/lib/dpkg/error.c
index cb736ef..f736df6 100644
--- a/lib/dpkg/error.c
+++ b/lib/dpkg/error.c
@@ -71,13 +71,12 @@ dpkg_put_errno(struct dpkg_error *err, const char *fmt, ...)
{
va_list args;
char *new_fmt;
- int errno_saved = errno;
- va_start(args, fmt);
- m_asprintf(&new_fmt, "%s (%s)", fmt, strerror(errno_saved));
- va_end(args);
+ m_asprintf(&new_fmt, "%s (%s)", fmt, strerror(errno));
+ va_start(args, fmt);
dpkg_error_set(err, DPKG_MSG_ERROR, new_fmt, args);
+ va_end(args);
free(new_fmt);
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]