< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate] Invalid parsing of UnknownHeaders (f.e. added via ExtensionHeader mechanism) with the same prefix


Hi All,

reSIProcate allows to construct and send messages containing headers 
like:

  P-aaabbb: str1
  P-aaa: str2

(i.e. where the latter header is a prefix of the former one).
The problem is that the headers are converted into:

  P-aaabbb: str1, str2

by reSIProcate on the receiving side.


Please apply the patch that fixes this bug:

Index: resip/stack/SipMessage.cxx
===================================================================
--- resip/stack/SipMessage.cxx  (revision 7094)
+++ resip/stack/SipMessage.cxx  (working copy)
@@ -1125,7 +1125,8 @@
       for (UnknownHeaders::iterator i = mUnknownHeaders.begin();
            i != mUnknownHeaders.end(); i++)
       {
-         if (strncasecmp(i->first.data(), headerName, headerLen) == 0)
+         if (i->first.size() == headerLen &&
+             strncasecmp(i->first.data(), headerName, headerLen) == 0)
          {
             // add to end of list
             if (len)

-- 
...Bye..Dmitry.