If WeaselJsonParser_create returns nullptr (e.g. negative stack size or allocation failure), set the existing error_ flag so that subsequent feed()/finish() calls return WeaselJson_REJECT instead of dereferencing the null parser_.
Also adds a regression test in contrib/schemagen/test_gen.cpp that constructs a RootBuilder with an invalid stack size and verifies it rejects without crashing.
Closes #36
If `WeaselJsonParser_create` returns `nullptr` (e.g. negative stack size or allocation failure), set the existing `error_` flag so that subsequent `feed()`/`finish()` calls return `WeaselJson_REJECT` instead of dereferencing the null parser_.
Also adds a regression test in `contrib/schemagen/test_gen.cpp` that constructs a `RootBuilder` with an invalid stack size and verifies it rejects without crashing.
If WeaselJsonParser_create returns nullptr (e.g. negative stack size or allocation failure), set the existing error_ flag so that subsequent feed()/finish() calls return WeaselJson_REJECT instead of dereferencing the null parser_.
Also add a regression test in test_gen.cpp that constructs a RootBuilder with an invalid stack size and verifies it rejects without crashing.
Closes#36
andrew
merged commit 241c29073b into main2026-06-30 15:35:21 +00:00
andrew
deleted branch weaselbot/issue-362026-06-30 15:35:21 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #36
If
WeaselJsonParser_createreturnsnullptr(e.g. negative stack size or allocation failure), set the existingerror_flag so that subsequentfeed()/finish()calls returnWeaselJson_REJECTinstead of dereferencing the null parser_.Also adds a regression test in
contrib/schemagen/test_gen.cppthat constructs aRootBuilderwith an invalid stack size and verifies it rejects without crashing.