Skip to content

Commit

Permalink
JSON output: fix segmentation fault of "print" output
Browse files Browse the repository at this point in the history
SEFAULT is caused by broken std::cout due to RTLD_DEEPBIND flag used during loading of the plugin.The issue requires further investigation.
  • Loading branch information
Lukas955 committed Apr 26, 2020
1 parent c9c2ed1 commit 8ca71e4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugins/output/json/src/Printer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ Printer::Printer(const struct cfg_print &cfg, ipx_ctx_t *ctx) : Output(cfg.name,
int
Printer::process(const char *str, size_t len)
{
(void) len;
std::cout << str;
// The string is not NULL terminated
const std::string temp = {str, len};
printf("%s", temp.c_str());
return IPX_OK;
}

0 comments on commit 8ca71e4

Please sign in to comment.