Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] formatting string with '\0' inside will cause crash #176

Closed
xywanz opened this issue May 27, 2022 · 1 comment
Closed

[bug] formatting string with '\0' inside will cause crash #176

xywanz opened this issue May 27, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@xywanz
Copy link

xywanz commented May 27, 2022

Here's the code that will crash.

#include "quill/Quill.h"
#include "fmt/format.h"

int main() {
  quill::enable_console_colours();
  quill::start();

  quill::Logger* logger = quill::get_logger();
  // construct a string with '\0' inside
  std::string msg = fmt::format("{} {} {} {} {}", (char)0, (char)0, (char)0, (char)0, "sssssssssssssssssssssss");
  QUILL_LOG_INFO(logger, "{}", msg);  // crash here
}

Although it's an incorrect usage, I think it should not cause crash.

@odygrd odygrd added the bug Something isn't working label May 29, 2022
@odygrd odygrd closed this as completed in b259b7f May 30, 2022
@odygrd
Copy link
Owner

odygrd commented May 30, 2022

hey, thanks for reporting this. It is now fixed in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants