lwp/iomgr.c: avoid off-by-one out-of-bounds access
authorNickolai Zeldovich <nickolai@csail.mit.edu>
Sun, 6 Jan 2013 04:45:46 +0000 (23:45 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 6 Jan 2013 16:35:02 +0000 (08:35 -0800)
Avoid accessing sigDelivered[NSIG] and sigEvents[NSIG], which are
out-of-bounds by one.

Change-Id: Id6a1798cba901987b8103f287e0869b31040b45b
Reviewed-on: http://gerrit.openafs.org/8883
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/lwp/iomgr.c

index 64e9f9c..b7dd1c2 100644 (file)
@@ -672,7 +672,7 @@ static int SignalSignals (void)
        sigProc[i] = 0;
     }
 
-    for (i = 1; i <= NSIG; ++i)  /* forall !badsig(i) */
+    for (i = 1; i < NSIG; ++i)  /* forall !badsig(i) */
        if ((sigsHandled & mysigmask(i)) && sigDelivered[i] == TRUE) {
            sigDelivered[i] = FALSE;
            LWP_NoYieldSignal (sigEvents[i]);