Skip to content

Add fuzzer for json_encode module#33

Draft
AdamKorcz wants to merge 1 commit intopython:mainfrom
AdamKorcz:add-json-encode-fuzzer
Draft

Add fuzzer for json_encode module#33
AdamKorcz wants to merge 1 commit intopython:mainfrom
AdamKorcz:add-json-encode-fuzzer

Conversation

@AdamKorcz
Copy link
Copy Markdown

@AdamKorcz AdamKorcz commented Apr 10, 2026

Adds a structured fuzzer for the _json C module's encoding paths (Modules/_json.c). The fuzzer constructs Python containers - int lists, string-keyed dicts, tuples, floats, and bare ints - from fuzzed input, then encodes them through json.dumps() under varied configurations. Separate branches exercise the default encoder, ensure_ascii in both modes, sort_keys, indented output with fuzzed indent levels, and a fully custom JSONEncoder with randomized separators and allow_nan settings. The goal is to cover the C-accelerated encoder's handling of diverse object graphs and option combinations..

@AdamKorcz AdamKorcz requested a review from a team as a code owner April 10, 2026 19:53
@AdamKorcz AdamKorcz marked this pull request as draft April 10, 2026 21:27
@AdamKorcz AdamKorcz marked this pull request as draft April 10, 2026 21:27
@AdamKorcz AdamKorcz marked this pull request as draft April 10, 2026 21:27
@AdamKorcz AdamKorcz force-pushed the add-json-encode-fuzzer branch from 0fe6cb6 to d43769c Compare April 11, 2026 21:00
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

Successfully merging this pull request may close these issues.

1 participant