jsoncpp icon indicating copy to clipboard operation
jsoncpp copied to clipboard

JSONCPP_USING_SECURE_MEMORY uses memset_s which isn't portable

Open tfc opened this issue 3 years ago • 1 comments

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:

  • not all compilers implement memset_s
  • the commit suggests this fixes a c++20 issue, but the meson (and cmake) file's c++ standard selection is not incremented from c++11

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):

  • OS: NixOS
  • Meson version 0.57.1
  • Ninja version 1.10.2

Additional context Add any other context about the problem here.

tfc avatar Mar 31 '22 18:03 tfc

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

TsynkPavel avatar Mar 31 '23 13:03 TsynkPavel