Hi,

this fixes a potential out-of-bound access in unwind-seh's GetGr/SetGr function.

ChangeLog

2014-06-23  Kai Tietz  <kti...@redhat.com>

    PR libgcc/61585
    * unwind-seh.c (_Unwind_GetGR): Check for proper
    index range.
    (_Unwind_SetGR): Likewise.


I will apply this patch after successful build and test.

Kai

Index: unwind-seh.c
===================================================================
--- unwind-seh.c        (Revision 211888)
+++ unwind-seh.c        (Arbeitskopie)
@@ -79,7 +79,7 @@ struct _Unwind_Context
 _Unwind_Word
 _Unwind_GetGR (struct _Unwind_Context *c, int index)
 {
-  if (index < 0 || index > 2)
+  if (index < 0 || index >= 2)
     abort ();
   return c->reg[index];
 }
@@ -89,7 +89,7 @@ _Unwind_GetGR (struct _Unwind_Context *c, int inde
 void
 _Unwind_SetGR (struct _Unwind_Context *c, int index, _Unwind_Word val)
 {
-  if (index < 0 || index > 2)
+  if (index < 0 || index >= 2)
     abort ();
   c->reg[index] = val;
 }

Reply via email to