buglwIP - A Lightweight TCP/IP stack - Bugs: bug #30963, httpd suspect behavior

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #30963: httpd suspect behavior

Submitter:  Jon H. Peterson <jonp>
Submitted:  Sat 04 Sep 2010 08:53:38 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Invalid
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  Other

Fri 17 Sep 2010 08:17:14 AM UTC, comment #4: 

Follow-up comment from Jon Peterson:

I tried to post to this item...not sure it made it or not. Dave is right and
this item should just be closed as no trouble found. I missed the closing }
when I posted it and the problem I thought existed does not. I am not sure how
I convinced myself that it was a problem in the first place. I am sorry for
causing any confusion or bothering anyone. Thanks, Jon

Kieran Mansley <kieranm>
Group Member
Fri 17 Sep 2010 06:31:21 AM UTC, comment #3: 

Ehrm, this seems kind of strange for some reasons:

a) when v1.3.2 was released, there was no CGI handling in the httpd since I did not merge Dave's code until 2 months later

b) regarding Dave's comment: the "if(i == g_iNumCGIs)" check is within the "if(g_iNumCGIs && g_pCGIs)" section, both in the original post as in the original webserver

-> this means to me that the original bug report is invalid

and finally:
c) 2 months ago, I dropped the code replacing the '?' since I wanted URLs to work with a '?' at the end, no matter if we have CGI support enabled or not (some browsers seem to add a '?' with no parameters following when using an empty INPUT box).

-> this means the bug has nothing to do with 1.4.0 RC1

Simon Goldschmidt <goldsimon>
Group administrator
Thu 16 Sep 2010 01:17:43 PM UTC, comment #2: 

In the light of David Wilson's comments, would anyone like to suggest a patch to sort this problem out?

Kieran Mansley <kieranm>
Group Member
Thu 16 Sep 2010 01:17:13 PM UTC, comment #1: 

This followup on mailing list on 7th September from Dave Wilson @ Stellaris

Jon,

  The "if(i == g_iNumCGIs)" test checks to see if we fell out of the end of the
loop without processing anything. In this case, the URI isn't for one of the
CGI handlers so it's treated normally. Looking at the code you added to the
note, it does seem that the bracing is wrong since this block should occur
within the "if(g_iNumCGIs && g_pCGIs)" section.

Kieran Mansley <kieranm>
Group Member
Sat 04 Sep 2010 08:53:38 PM UTC, original submission:  

v1.3.2
if the if statement,  if(g_iNumCGIs && g_pCGIs), fails, then the if below, if(i == g_iNumCGIs), is problematic (since i was never set by the loop) and the Null that was inserted at params may not be replaced....i supposed this really shouldn't happen, but users do make mistakes (hard to believe). not sure i understand what the if(i == g_iNumCGIs) is supposed to do?
jon


  /* Does the base URI we have isolated correspond to a CGI handler? */
          if(g_iNumCGIs && g_pCGIs) {
            for(i = 0; i < g_iNumCGIs; i++) {
              if(strcmp(uri, g_pCGIs[i].pcCGIName) == 0) {
                /*
                 * We found a CGI that handles this URI so extract the
                 * parameters and call the handler.
                 */
                 count = extract_uri_parameters(hs, params);
                 uri = g_pCGIs[i].pfnCGIHandler(i, count, hs->params,
                                                hs->param_vals);
                 break;
              }
            }

            /* Did we handle this URL as a CGI? If not, reinstate the
             original URL and pass it to the file system directly. /
            if(i == g_iNumCGIs)
            {
              /* Replace the ? marker at the beginning of the parameters */
              if(params) {
                 params--;
                *params = '?';
              }

Jon H. Peterson <jonp>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by kieranm (Posted a comment)
  • -email is unavailable- added by jonp (Submitted the item)
  • -email is unavailable- added by jonp
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-09-17 goldsimon StatusNone Invalid
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2010-09-04 jonp Carbon-Copy- Added jonp

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code