fatal-signal: Fix bug in call_hooks() recursion detection.
authorBen Pfaff <blp@nicira.com>
Fri, 9 Jan 2009 01:20:34 +0000 (17:20 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 13 Jan 2009 01:17:53 +0000 (17:17 -0800)
Found by Chris Eagle via Fortify.

lib/fatal-signal.c

index ac9e2a5..35a37bf 100644 (file)
@@ -167,7 +167,7 @@ atexit_handler(void)
 static void
 call_hooks(int sig_nr)
 {
-    volatile sig_atomic_t recurse = 0;
+    static volatile sig_atomic_t recurse = 0;
     if (!recurse) {
         size_t i;