Project

General

Profile

Actions

Bug #1287

closed

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

Added by ralf over 16 years ago. Updated over 16 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

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".

Actions #1

Updated by jan over 16 years ago

  • Status changed from New to Fixed
  • Resolution set to fixed

Yep, that works.

Fix applied in r1927

Actions

Also available in: Atom