diff options
author | Adam Harvey <aharvey@php.net> | 2013-06-19 11:32:37 -0700 |
---|---|---|
committer | Adam Harvey <aharvey@php.net> | 2013-06-20 09:31:57 -0700 |
commit | 283f56af6696f57400bdbf8ce29ee66e64249c0d (patch) | |
tree | 070d31310cb4aea0105be3f7987e63a48e90738f /ext/intl/breakiterator/codepointiterator_methods.cpp | |
parent | b5978e239ee308e425843e40eb6ab2a9f0beba83 (diff) | |
download | php-git-283f56af6696f57400bdbf8ce29ee66e64249c0d.tar.gz |
Change the search in get_status_string() to correctly handle unknown codes.
This previously used a buggy implementation of binary search that would loop
infinitely for unknown codes when searching in reason arrays of particular
sizes (such as the one we have at the moment). Since C provides bsearch(),
we'll just use that instead, since libc authors hopefully get this right.
There was also an additional bug that was masked by the first one: the design
was that an unknown code would result in get_status_string() returning NULL,
which would then result in a segfault in append_http_status_line(), since it
assumed that it would always receive a valid string pointer that could be
handed off to smart_str_appends_ex(). We'll now return a placeholder in that
case.
Fixes bug #65066 (Cli server not responsive when responding with 422 http
status code).
Diffstat (limited to 'ext/intl/breakiterator/codepointiterator_methods.cpp')
0 files changed, 0 insertions, 0 deletions