[reSIProcate] ParserCategory will accept empty parameters
Byron Campen
bcampen at estacado.net
Thu Aug 3 11:31:27 CDT 2006
In ParserCategory::parseParameters(), the following code will accept
empty parameters:
*snip*
if ( (!pb.eof() && *pb.position() == Symbols::SEMI_COLON[0]) )
{
// extract the key
pb.skipChar();
const char* keyStart = pb.skipWhitespace();
const char* keyEnd = pb.skipToOneOf(" \t\r\n;=?>"); //!
dlb! @ here?
ParameterTypes::Type type = ParameterTypes::getType
(keyStart, (keyEnd - keyStart));
if (type == ParameterTypes::UNKNOWN)
{
mUnknownParameters.push_back(new UnknownParameter(keyStart,
int
((keyEnd - keyStart)), pb, " \t\r\n;?>"));
}
else
{
// invoke the particular factory
mParameters.push_back(ParameterTypes::ParameterFactories
[type](type, pb, " \t\r\n;?>"));
}
}
*snip*
This isn't such a bad thing for a endpoint, but servers MUST not re-
emit this sort of thing. Also, someone could eat us alive if they
sent traffic containing stuff like this to us:
To:
"Kaboom"<sip:foo at bar;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;etc... out to ~64K>
We'd end up filling a std::vector with around 60K empty Datas for
every message sent at us.
Best regards,
Byron Campen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20060803/3d0d2889/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2369 bytes
Desc: not available
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20060803/3d0d2889/attachment.bin>
More information about the resiprocate-devel
mailing list