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

JSONCPP_USING_SECURE_MEMORY uses memset_s which isn't portable #1399

Open
tfc opened this issue Mar 31, 2022 · 1 comment
Open

JSONCPP_USING_SECURE_MEMORY uses memset_s which isn't portable #1399

tfc opened this issue Mar 31, 2022 · 1 comment

Comments

@tfc
Copy link
Contributor

tfc commented Mar 31, 2022

Describe the bug

Starting with 30170d6, 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.

@TsynkPavel
Copy link
Contributor

TsynkPavel commented Mar 31, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants