joncrall
2c9e70f965
Run benchmarks in CI when they are changed
2022-04-25 14:11:11 -04:00
joncrall
e8fc9e1190
Add proper default to disable
2022-04-25 14:08:03 -04:00
Hugo van Kemenade
a900e469f9
Merge pull request #533 from Erotemic/benchmark-flexibility
2022-04-25 12:09:01 +03:00
JustAnotherArchivist
66060a0fab
Add and fix debug memory checks for all buffer appends on encoding
...
In DEBUG mode, this ensures that all buffer appends are safe.
It also refactors direct `memcpy` calls into a helper `Buffer_memcpy` function that ensures correct buffer pointer movement and has a similar safety check.
2022-04-24 13:58:00 -07:00
joncrall
3d25fb4fe6
remove skip-lib-comps command
2022-04-22 18:57:46 -04:00
joncrall
991bf12059
Merge branch 'benchmark-flexibility' of github.com:Erotemic/ultrajson into benchmark-flexibility
2022-04-21 17:34:06 -04:00
joncrall
3850b93182
Remove cpuinfo
2022-04-21 17:33:51 -04:00
pre-commit-ci[bot]
3eb7a19f60
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2022-04-21 21:13:27 +00:00
joncrall
eb71ee87c5
Merge branch 'benchmark-flexibility' of github.com:Erotemic/ultrajson into benchmark-flexibility
2022-04-21 16:59:41 -04:00
pre-commit-ci[bot]
79a6122e5f
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2022-04-21 20:59:32 +00:00
joncrall
78f24e290e
Add note about units of benchmarks
2022-04-21 16:57:05 -04:00
joncrall
32de298ee7
Added argparse CLI with ability to disable specific modules
2022-04-21 16:39:34 -04:00
joncrall
ccd30400b0
Generalize the way new json modules can be added to existing benchmarks
2022-04-21 16:16:22 -04:00
JustAnotherArchivist
b3f8754c8a
Fix segmentation faults when handling unserialisable objects
...
Errors during `__repr__` itself as well as ones during the conversion to a bytes object were not handled, resulting in NULL pointer dereferencing.
Cf. #382
2022-04-18 12:20:18 +01:00
Hugo van Kemenade
779949896e
Merge pull request #526 from JustAnotherArchivist/fix-obj-str-exception-segv
...
Fix segmentation fault when an exception is raised while converting a dict key to a string
2022-04-14 07:00:55 +03:00
Hugo van Kemenade
b8a85c8488
Merge pull request #527 from JustAnotherArchivist/fuzz-ref-count
...
Add ref count checks to fuzz tests
2022-04-13 21:55:22 +03:00
Hugo van Kemenade
19c21d4801
Merge pull request #528 from JustAnotherArchivist/test-sorted-key-ref-counts
...
Add test for key ref counts with sort_keys enabled
2022-04-13 08:59:34 +03:00
JustAnotherArchivist
97fceb6245
Add test for key ref counts with sort_keys enabled
2022-04-13 03:02:55 +00:00
JustAnotherArchivist
9ac2133e0f
Add ref count checks to fuzz tests
2022-04-13 02:52:17 +00:00
JustAnotherArchivist
935fe0cec4
Fix segmentation fault when an exception is raised while converting a dict key to a string
...
Fixes #522
2022-04-13 00:04:24 +00:00
JustAnotherArchivist
62dec8de71
Fix ref counting on non-string dict keys
...
For bytes, there was an extraneous INCREF; PyIter_Next returns a new reference. For other non-strings, the original itemName before converting to a string was never dereferenced.
Fixes #419
2022-04-07 20:31:36 +01:00
JustAnotherArchivist
2d1f088c2e
Fix ref counting on repeated default function calls
...
Fixes #523
2022-04-07 20:20:01 +01:00
JustAnotherArchivist
f6860f1f3d
Remove shebang
...
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-04-05 21:04:39 +01:00
JustAnotherArchivist
c0ff7b1df9
python -m pytest
...
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-04-05 21:04:39 +01:00
JustAnotherArchivist
362fed3cdc
Clearer pytest command
...
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-04-05 21:04:39 +01:00
JustAnotherArchivist
82917c0cb1
actions/checkout@v3
...
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-04-05 21:04:39 +01:00
JustAnotherArchivist
3c095f1912
Widen tests to cover more possible buffer overflows
...
If the default output format changes in the future (e.g. `separators` as in the standard library), these tests would otherwise become irrelevant.
2022-04-05 21:04:39 +01:00
JustAnotherArchivist
f4d2c87ab6
Refactor buffer reservations to ensure sufficient space on all additions
...
* Removed the reservations in Buffer_EscapeStringUnvalidated and Buffer_EscapeStringValidated as those are not needed and may hide other bugs.
* Debug check in Buffer_EscapeStringValidated was triggering incorrectly.
* The reservation on JT_RAW was much larger than necessary; the value is copied directly, so the factor six is not needed, and this may hide other bugs.
* Explicit accurate reservations everywhere else.
2022-04-05 21:04:39 +01:00
Brénainn Woodsend
1846e082a1
Add fuzz test to CI/CD.
2022-04-05 21:04:39 +01:00
Brénainn Woodsend
5875168c41
Fix some more seg-faults on encoding.
2022-04-05 21:04:39 +01:00
Brénainn Woodsend
1a39406b3a
Remove the hidden JSON_NO_EXTRA_WHITESPACE compile knob.
...
Unsetting it can lead to seg-faults. I don't think it's worth having to fix and
then test this undocumented permutation.
2022-04-05 21:04:39 +01:00
Brénainn Woodsend
20aa1a69e5
Add a fuzzing test to search for segfaults in encoding.
2022-04-05 21:04:39 +01:00
Brénainn Woodsend
61dd6f19e8
Fix unchecked buffer overflows (CVE-2021-45958).
...
Add a few extra memory reserve calls to account for the extra space that
indentation needs.
These kinds of memory issues are hard to spot because the buffer is resized in
powers of 2 meaning that a miscalculation would only show any symptoms if the
required buffer size is estimated to be just below a 2 power but is actually
just above. Add a debug mode which replaces the 2 power scheme with reserving
only the memory explicitly requested and adds some overflow checks.
2022-04-05 21:04:39 +01:00
Hugo van Kemenade
881ee9317b
Merge pull request #514 from Erotemic/nan_loads
2022-04-04 23:29:22 +03:00
pre-commit-ci[bot]
2421524a1c
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2022-04-04 19:28:00 +00:00
Jon Crall
9f0326265d
Update tests/test_ujson.py
...
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-04-04 15:27:41 -04:00
Hugo van Kemenade
beb3296e7c
Merge pull request #516 from ultrajson/pre-commit-ci-update-config
2022-04-04 21:30:14 +03:00
pre-commit-ci[bot]
3f9f9076fb
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2022-04-04 18:22:41 +00:00
joncrall
bb35930777
Added more nan/inf tests
2022-04-04 14:22:24 -04:00
pre-commit-ci[bot]
85623a0437
[pre-commit.ci] pre-commit autoupdate
...
updates:
- [github.com/asottile/pyupgrade: v2.31.0 → v2.31.1](https://github.com/asottile/pyupgrade/compare/v2.31.0...v2.31.1 )
- [github.com/asottile/setup-cfg-fmt: v1.20.0 → v1.20.1](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.0...v1.20.1 )
2022-04-04 18:01:31 +00:00
joncrall
749012c4a4
Ran black
2022-04-04 13:56:19 -04:00
joncrall
13aa30e152
Fix nan bug in pandas port
2022-04-04 13:56:19 -04:00
joncrall
f090103b31
NaN and Inf in loads - Port of Pandas #30295
2022-04-04 13:56:11 -04:00
Hugo van Kemenade
b3c96d0bd9
Merge pull request #515 from ultrajson/hugovk-patch-1
...
Upgrade Black to fix Click
2022-04-04 07:31:27 +03:00
pre-commit-ci[bot]
c930b22f18
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2022-04-03 21:53:28 +00:00
Hugo van Kemenade
e185a9fd09
Upgrade Black to fix Click
2022-04-04 00:53:18 +03:00
Hugo van Kemenade
20927fdf82
Upgrade Black to fix Click
2022-04-04 00:51:27 +03:00
Hugo van Kemenade
aa0d2c8517
Merge pull request #511 from ultrajson/all-repos_autofix_all-repos-sed
...
Upgrade to actions/setup-python@v3
2022-03-01 12:50:43 +02:00
Hugo van Kemenade
0ecfcf39db
Upgrade to actions/setup-python@v3
...
Committed via https://github.com/asottile/all-repos
2022-03-01 11:48:23 +02:00
RouquinBlanc
e6dc25cf12
simplify exception handling on integer overflow
2022-02-20 11:01:24 +00:00