From 979c0669de19dcb5c0a13284141f43206651744f Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Fri, 28 Mar 2014 09:27:56 -0400 Subject: [PATCH] Protect against bad summary types Ensure that if we are asked for summary information in Patron Information that we have any form of definition for it *and* we have code to call. If neither case is true pretend they didn't ask for any to begin with. Signed-off-by: Thomas Berezansky --- Sip/MsgType.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sip/MsgType.pm b/Sip/MsgType.pm index 6fb4793..1e4d00a 100644 --- a/Sip/MsgType.pm +++ b/Sip/MsgType.pm @@ -897,6 +897,12 @@ sub summary_info { return ''; } + if ($summary_type > $#summary_map || not defined $summary_map[$summary_type]->{func}) { + # Huh, we don't have any code to handle the requested summary information. + # Pretend nothing was asked for instead. + return ''; + } + syslog("LOG_DEBUG", "Summary_info: index == '%d', field '%s'", $summary_type, $summary_map[$summary_type]->{fid}); -- 2.11.0