BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001184 [BusyBox] Networking Support major always 01-29-07 06:54 03-05-07 08:56
Reporter aschultz View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version 1.4.x
Summary 0001184: httpd cgi implementation broken by cset 17196
Description cset 17196 contains this beauty (slightly edited to highlight my point):

- if (strncmp(rbuf, "HTTP/1.0 200 OK\r\n", 4) != 0) {
- /* there is no "HTTP", do it ourself */
- full_write(s, "HTTP/1.0 200 OK\r\n", 17);
- } /* hmm, maybe 'else if'? */
- if (!strstr(rbuf, "ontent-")) {
- full_write(s, "Content-type: text/plain\r\n\r\n", 28);
- }
- firstLine = 0;
+#define HTTP_200 "HTTP/1.0 200 OK\r\n\r\n"
+ if (memcmp(rbuf, HTTP_200, 4) != 0) {
+ /* there is no "HTTP", do it ourself */
+ full_write(s, HTTP_200, sizeof(HTTP_200)-1);
+ }
+#undef HTTP_200

This breaks cgi scripts that omit to send a HTTP/1.0 header but continue to send other headers. The fix is simple, change the #define HTTP_200 to:
#define HTTP_200 "HTTP/1.0 200 OK\r\n"
Additional Information
Attached Files

- Relationships

- Notes
(0002203)
landau
03-05-07 02:12

I second it.
The trunk code has changed since then, but the bug persists.
Changing in the trunk
static const char HTTP_200[] = "HTTP/1.0 200 OK\r\n\r\n";
to
static const char HTTP_200[] = "HTTP/1.0 200 OK\r\n";
seems to fix the bug.
 
(0002210)
vda
03-05-07 08:56

Fixed in svn. Thanks!
 

- Issue History
Date Modified Username Field Change
01-29-07 06:54 aschultz New Issue
01-29-07 06:54 aschultz Status new => assigned
01-29-07 06:54 aschultz Assigned To  => BusyBox
03-05-07 02:12 landau Note Added: 0002203
03-05-07 02:57 landau Issue Monitored: landau
03-05-07 08:56 vda Status assigned => closed
03-05-07 08:56 vda Note Added: 0002210
03-05-07 08:56 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker