summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2010-10-16 05:55:33 +0200
committerGuillem Jover <guillem@debian.org>2010-11-19 05:21:12 +0100
commit43789e59f08dae79b07feb004c0fa1b5d357b47d (patch)
tree3c0bfa48213057d9cccd84df2cf5e96b7a897869 /lib
parentb571373cd2e62782c3bb2b8e0bef585c4215b967 (diff)
downloaddpkg-43789e59f08dae79b07feb004c0fa1b5d357b47d.tar.gz
libdpkg: Make run_error_handler cope with NULL econtext gracefully
This could happen if the context has not been initialized, or if it has been unwinded more than necessary.
Diffstat (limited to 'lib')
-rw-r--r--lib/dpkg/ehandle.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/dpkg/ehandle.c b/lib/dpkg/ehandle.c
index 09b1a770c..093e6f61a 100644
--- a/lib/dpkg/ehandle.c
+++ b/lib/dpkg/ehandle.c
@@ -97,6 +97,12 @@ run_error_handler(void)
fprintf(stderr, _("%s: unrecoverable fatal error, aborting:\n %s\n"),
thisname, errmsg);
exit(2);
+ }
+
+ if (econtext == NULL) {
+ fprintf(stderr, _("%s: outside error context, aborting:\n %s\n"),
+ thisname, errmsg);
+ exit(2);
} else {
longjmp(*econtext->jump, 1);
}