RE: [reSIProcate] Bug in DateCategory::parse()
Here's a quick little patch that fixes the problem. Maybe not the cleanest
way to handle it but it works:
Index: DateCategory.cxx
===================================================================
--- DateCategory.cxx (revision 5639)
+++ DateCategory.cxx (working copy)
@@ -485,12 +485,18 @@
const char* anchor = pb.skipWhitespace();
- pb.skipToChar(Symbols::COMMA[0]);
- Data dayOfWeek;
- pb.data(dayOfWeek, anchor);
- mDayOfWeek = DateCategory::DayOfWeekFromData(dayOfWeek);
+ if(pb.skipToChar(Symbols::COMMA[0]) != pb.end())
+ {
+ Data dayOfWeek;
+ pb.data(dayOfWeek, anchor);
+ mDayOfWeek = DateCategory::DayOfWeekFromData(dayOfWeek);
- pb.skipChar(Symbols::COMMA[0]);
+ pb.skipChar(Symbols::COMMA[0]);
+ }
+ else
+ {
+ pb.reset(pb.start());
+ }
pb.skipWhitespace();
-----Original Message-----
From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx
[mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Martin
Dill
Sent: Thursday, December 01, 2005 4:41 PM
To: resiprocate-devel@xxxxxxxxxxxxxxxxxxx
Subject: [reSIProcate] Bug in DateCategory::parse()
Hi,
There appears to be a bug in DateCategory::parse().
As far as I can tell, it assumes that the date it is given will always be in
the form 'Mon, 04 Nov 2002 17:34:15 GMT'. However, I think this is
incorrect. According to RFC822, the day part is optional. When resip is
given a date in the form '04 Nov 2002 17:34:15 GMT', without the day part,
it fails with an exception of 'parsebuffer.cxx:78, Parse failed skipped over
eof in context: Date'.
Can someone verify this?
Thanks
Martin Dill
NewHeights Software
_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxxxxxx
https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel