Closed bcsgh closed 1 year ago
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.
httpserver::error_log
httpserver::create_webserver::debug()
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
GnuTLS failed to setup x509 certificate/key: %s
gnutls_strerror
Reproduces how often: 100% (Somewhere between 10%-30% of error messages use formatting.)
I've got a PR ready to go.
Prerequisites
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
httpserver::create_webserver::debug()
and `httpserver::create_webserver::log_error(...)'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 fromgnutls_strerror
e.g. https://github.com/Karlson2k/libmicrohttpd/blob/a0cb931f0c158f27ed297ad04e0a3c267adca271/src/microhttpd/daemon.c#L602Reproduces how often: 100% (Somewhere between 10%-30% of error messages use formatting.)
Versions
Additional Information
I've got a PR ready to go.