Skip to content

[BUG] httpserver::error_log ignores argument it is supposed to printf format. #297

@bcsgh

Description

@bcsgh

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

  1. build a server that uses https
  2. turn on logging via httpserver::create_webserver::debug() and `httpserver::create_webserver::log_error(...)'
  3. 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.

Metadata

Metadata

Assignees

Labels

bugConfirmed bugs or reports that are very likely to be bugs.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions