aboutsummaryrefslogtreecommitdiff
path: root/src/test/httpserver_tests.cpp
AgeCommit message (Collapse)Author
2023-04-17bugfix: rest: avoid segfault for invalid URIpablomartin4btc
`evhttp_uri_parse` can return a nullptr, for example when the URI contains invalid characters (e.g. "%"). `GetQueryParameterFromUri` passes the output of `evhttp_uri_parse` straight into `evhttp_uri_get_query`, which means that anyone calling a REST endpoint in which query parameters are used (e.g. `rest_headers`) can cause a segfault. This bugfix is designed to be minimal and without additional behaviour change. Follow-up work should be done to resolve this in a more general and robust way, so not every endpoint has to handle it individually.
2022-03-10Add GetQueryParameter helper functionstickies-v
Easily get the query parameter from the URI, with optional default value.