open-source-parsers / jsoncpp

A C++ library for interacting with JSON.
Other
8.17k stars 2.64k forks source link

JSONCPP_USING_SECURE_MEMORY uses memset_s which isn't portable #1399

Open tfc opened 2 years ago

tfc commented 2 years ago

Describe the bug

Starting with https://github.com/open-source-parsers/jsoncpp/commit/30170d651c108400b1b9ed626ba715a5d95c5fd2, the library uses memset_s for the secure string allocator.

This is problematic, because:

Apart from that, the unit tests won't build because many spots the test code tries to convert between std::string and the custom allocator string.

To Reproduce Steps to reproduce the behavior:

  1. activate JSONCPP_USING_SECURE_MEMORY
  2. build the code

Expected behavior

The code should compile with any C++ compiler. The tests should compile regardless of the string allocator.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

TsynkPavel commented 1 year ago

Hello ! I partially supported what you are talking about in #1478 & #1479