From 7b7d083237fdad2079d1916a26b3e82c1266ce52 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 24 Feb 2010 08:56:36 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=25 --- bash-4.1-intr.dif | 26 +++++++++++++++++++++++++- bash.changes | 5 +++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/bash-4.1-intr.dif b/bash-4.1-intr.dif index 21d8fb09..9601585e 100644 --- a/bash-4.1-intr.dif +++ b/bash-4.1-intr.dif @@ -15,7 +15,7 @@ #if 0 --- xmalloc.c -+++ xmalloc.c 2010-02-15 15:36:40.113797875 +0000 ++++ xmalloc.c 2010-02-24 08:32:51.452626384 +0000 @@ -35,6 +35,11 @@ # include "ansi_stdlib.h" #endif /* HAVE_STDLIB_H */ @@ -121,3 +121,27 @@ if (temp == 0) allocerr ("xrealloc", bytes); +@@ -145,7 +204,22 @@ xfree (string) + PTR_T string; + { + if (string) +- free (string); ++ { ++ sigset_t set, oset; ++ int blocked_sigs = 0; ++ ++ /* Block all signals in case we are executed from a signal handler. */ ++ if (interrupt_immediately || signal_is_trapped (SIGINT) || signal_is_trapped (SIGCHLD)) ++ { ++ block_signals (&set, &oset); ++ blocked_sigs = 1; ++ } ++ ++ free (string); ++ ++ if (blocked_sigs) ++ unblock_signals (&set, &oset); ++ } + } + + #ifdef USING_BASH_MALLOC diff --git a/bash.changes b/bash.changes index ed8028a0..5ed4d61c 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Feb 24 09:55:03 CET 2010 - werner@suse.de + +- Avoid hang due malloc()/free() within signal handler (bnc#522351) + ------------------------------------------------------------------- Thu Feb 18 11:05:13 CET 2010 - werner@suse.de