This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=f5ddb3da13bd645bb7d800b0d5476c2147b13b15

commit f5ddb3da13bd645bb7d800b0d5476c2147b13b15
Author: Guillem Jover <[email protected]>
AuthorDate: Sat May 23 05:26:50 2020 +0200

    libdpkg: Do not use econtext->errmsg on out of context abort
    
    When we do not have an econtext in place, either because it has not been
    setup yet, or because the last one got pop'ed, we cannot use its errmsg
    member. Instead use a new string to explain the problem.
    
    Warned-by: clang-11
---
 debian/changelog   | 2 ++
 lib/dpkg/ehandle.c | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index ea216b520..f053ccb9b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,6 +22,8 @@ dpkg (1.20.1) UNRELEASED; urgency=medium
     parser:
     - Move the version unterminated case before the catchall.
     - Print the actual wrong character and print what is expected.
+  * libdpkg: Do not use econtext->errmsg on out of context abort, as it might
+    be uninitialized.
   * Portability:
     - libdpkg: When using uselocale(), include <xlocale.h> for locale_t if
       the header is available. Needed on BSDs.
diff --git a/lib/dpkg/ehandle.c b/lib/dpkg/ehandle.c
index e525db003..5bc459a0c 100644
--- a/lib/dpkg/ehandle.c
+++ b/lib/dpkg/ehandle.c
@@ -432,7 +432,8 @@ run_error_handler(void)
   }
 
   if (econtext == NULL) {
-    print_abort_error(_("outside error context, aborting"), econtext->errmsg);
+    print_abort_error(_("outside error context, aborting"),
+                      _("an error occurred with no error handling in place"));
     exit(2);
   } else if (econtext->handler_type == HANDLER_TYPE_FUNC) {
     econtext->handler.func();

-- 
Dpkg.Org's dpkg

Reply via email to