Skip to content

JSONCPP_USING_SECURE_MEMORY uses memset_s which isn't portable #1399

Open
@tfc

Description

@tfc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions