Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/lib/libunwind Missing register validation check.



details:   https://anonhg.NetBSD.org/src/rev/54e7a85c8484
branches:  trunk
changeset: 329064:54e7a85c8484
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sat May 03 23:19:56 2014 +0000

description:
Missing register validation check.

diffstat:

 sys/lib/libunwind/DwarfParser.hpp |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r a83039ee4aed -r 54e7a85c8484 sys/lib/libunwind/DwarfParser.hpp
--- a/sys/lib/libunwind/DwarfParser.hpp Sat May 03 16:43:10 2014 +0000
+++ b/sys/lib/libunwind/DwarfParser.hpp Sat May 03 23:19:56 2014 +0000
@@ -461,6 +461,8 @@
       reg = R::dwarf2regno(addressSpace.getULEB128(p, instructionsEnd));
       offset =
           addressSpace.getULEB128(p, instructionsEnd) * cieInfo.dataAlignFactor;
+      if (reg > kMaxRegisterNumber)
+        return false;
       results->savedRegisters[reg].location = kRegisterOffsetFromCFA;
       results->savedRegisters[reg].value = offset;
       break;



Home | Main Index | Thread Index | Old Index