After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 406997 - soup_headers_parse_status_line not working as per specification
soup_headers_parse_status_line not working as per specification
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
2.2.x
Other All
: Normal blocker
: ---
Assigned To: Dan Winship
Dan Winship
Depends on:
Blocks:
 
 
Reported: 2007-02-12 09:14 UTC by Andrew McMillan
Modified: 2007-02-12 20:58 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Fix to allow null-terminated status response to be parsed as documented (1.25 KB, patch)
2007-02-12 09:18 UTC, Andrew McMillan
none Details | Review

Description Andrew McMillan 2007-02-12 09:14:02 UTC
Please describe the problem:
This commit:

http://svn.gnome.org/viewcvs/libsoup/trunk/libsoup/soup-headers.c?rev=905&r1=893&r2=905

states that "@status_line must be terminated by either '\0' or '\r\n'.", but in the actual implementation, in the same commit, it appears that the function will return FALSE unless the last character in the string is '\n':

Since strchr() will return NULL if the character is not found, this code will necessarily return FALSE for \0 terminated strings, such as those parsed from <multistatus> XML responses by Evolution's CalDAV plugin... :-)

Since Evolution actually checks the return code, this causes Evolution's CalDAV plugin not to work any longer :-(



Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
I have a patch for this, which fixes the problem (Evolution CalDAV now works for me)
Comment 1 Andrew McMillan 2007-02-12 09:18:17 UTC
Created attachment 82373 [details] [review]
Fix to allow null-terminated status response to be parsed as documented

I am not entirely sure whether the strlen() is sufficient, or should have a "+1" on it... or indeed if there is a better, multibyte aware strlen that should be used here...
Comment 2 Dan Winship 2007-02-12 15:16:28 UTC
Fixed (slightly differently) in svn. Sorry about that. This will go out today in libsoup 2.2.100 which should be released as part of GNOME 2.18 beta2 on Wednesday.
Comment 3 Andrew McMillan 2007-02-12 20:58:47 UTC
Thanks for that.  I realised afterwards that my patch was somewhat broken, and worked out (in several places) what I had done wrong.

Your patch, however, is much cleaner and shows up exactly how much C I have forgotten in the last 20 years :-)