Ticket #1287 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

lighttpd-1.4.16 - buffer_caseless_compare() - returns wrong results if length of "a" and "b" differs

Reported by: ralf Assigned to: jan
Priority: normal Milestone: 1.4.17
Component: core Version: 1.4.15
Severity: normal Keywords:
Cc: Blocking:
Need Feedback: 0

Description

sending a request like this:

HEAD / HTTP/1.0
Connection: k

or

HEAD / HTTP/1.0
Connection: keep-alivewhatever

lighttpd thinks its keep-alive.

the problem is in buffer_caseless_compare() which returns 0 (buffers equal) if the length differs and the first characters are equal.

resolution whould be to:

return a_len - b_len;

but i dont know if this works really correct because of:

} else if (cmp > 0 && 0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("Content-Length")))) {

in request.c, here i mean "cmp > 0".

Attachments

Change History

08/17/2007 09:48:20 PM changed by jan

  • status changed from new to closed.
  • resolution set to fixed.

Yep, that works.

Fix applied in [1927]


Add/Change #1287 (lighttpd-1.4.16 - buffer_caseless_compare() - returns wrong results if length of "a" and "b" differs)




Change Properties
Action