From 7e3335542c7f4e37dba8db3cefd59dde1e1b10ca Mon Sep 17 00:00:00 2001 From: joerg Date: Sat, 3 May 2014 23:19:56 +0000 Subject: [PATCH] Missing register validation check. --- sys/lib/libunwind/DwarfParser.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/lib/libunwind/DwarfParser.hpp b/sys/lib/libunwind/DwarfParser.hpp index 509f6d57f158..6e8ef2cab4c7 100644 --- a/sys/lib/libunwind/DwarfParser.hpp +++ b/sys/lib/libunwind/DwarfParser.hpp @@ -461,6 +461,8 @@ CFI_Parser::parseInstructions(A &addressSpace, pint_t instructions, 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;