[BUG] httpserver::error_log ignores argument it is supposed to printf format.
bcsgh opened this issue · 0 comments
bcsgh commented
Prerequisites
- Put an X between the brackets on this line if you have checked that your issue isn't already filed: https://github.com/search?l=&q=repo%3Aetr%2Flibhttpserver&type=Issues
Description
httpserver::error_log is called in a context where it's expected to act link printf and format the passed argument list. Currently it just ignores it.
Steps to Reproduce
- build a server that uses https
- turn on logging via
httpserver::create_webserver::debug()and `httpserver::create_webserver::log_error(...)' - feed mismatch cert and key files (just one example)
Expected behavior:
A log message explaining the issue.
Actual behavior:
A format string like GnuTLS failed to setup x509 certificate/key: %s without the error message from gnutls_strerror
e.g. https://github.com/Karlson2k/libmicrohttpd/blob/a0cb931f0c158f27ed297ad04e0a3c267adca271/src/microhttpd/daemon.c#L602
Reproduces how often: 100% (Somewhere between 10%-30% of error messages use formatting.)
Versions
- OS version (if on linux, the output of "uname -a")
- libhttpserver version 0.18.2 (from github)
- libmicrohttpd version 0.9.75 (src)
Additional Information
I've got a PR ready to go.