HomePhabricator

tests: Avoid fuzzer-specific nullptr dereference in libevent when handling…

Description

tests: Avoid fuzzer-specific nullptr dereference in libevent when handling PROXY requests

Summary:

The dereference (req->evcon->http_server) takes place in
evhttp_parse_request_line and is a consequence of our hacky but
necessary use of the internal function evhttp_parse_firstline_ in the
http_request fuzzing harness.

The suggested workaround is not aesthetically pleasing, but it
successfully avoids the troublesome code path.

" http:// HTTP/1.1\n" was a crashing input prior to this workaround.

Backport of core PR19140.

Depends on D9001.

Test Plan:

ninja bitcoin-fuzzers
echo " http:// HTTP/1.1" > input
./src/test/fuzz/http_request input

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D9002

Details

Provenance
practicalswift <practicalswift@users.noreply.github.com>Authored on Jun 2 2020, 09:34
FabienCommitted on Jan 21 2021, 14:05
FabienPushed on Jan 21 2021, 14:07
Reviewer
Restricted Project
Differential Revision
D9002: tests: Avoid fuzzer-specific nullptr dereference in libevent when handling PROXY requests
Parents
rABC1684b6761b2b: fuzz: http_request workaround for libevent < 2.1.1
Branches
Unknown
Tags
Unknown