Skip to content

Loader tests: ASan/UBSan pass and a loader-level NUL fixture #69

Open

Description

@djbclark

What is wrong

Two test gaps around the strict JSON parse and the CMDB loader.

A. No sanitizer pass

The memory-safety claims are tested without a sanitizer. Where (at 75db441): .github/workflows/linux.yml:129

make -j"$(nproc)" CFLAGS="-Wall"

and linux.yml:136-137. The error-path frees of the new strict parse and the rollback in cmdb.c run only as plain cmocka tests.

Suggested fix: one ASan/UBSan pass of json_test and cmdb_test, in the overlay-build job or the fork's CI. It would also catch the trailing-backslash read past the NUL in JsonParseAsString (follow-up issue on that defect).

B. No loader-level NUL fixture

An embedded NUL is tested only in libntech's json_test (test_parse_file_strict). cmdb_test and run.sh have no NUL fixture; the loader-level proof is only that cmdb.c calls JsonParseFileStrict() directly. This is on the fork side.

Suggested fix: add a loader-level fixture with an embedded NUL to cmdb_test (and run.sh) that must install nothing.

Found in review of #65 (head 75db441).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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