[LTP] [PATCH 00/15] Fix ujson bugs

Andrea Cervesato andrea.cervesato@suse.de
Mon Oct 5 15:25:28 CEST 2026


- fix 4-byte UTF-8 sequence decoding in ujson_utf8_next()
- fix out-of-bounds read on invalid UTF-8 in ujson_writer
- prevent infinite loop when read() returns 0 in ujson_reader
- fix inverted open() error check in ujson_writer_file_open()
- combine UTF-16 surrogate pairs and reject lone surrogates
- check for signed integer overflow when parsing numbers
- fix error propagation when newline() fails in ujson_writer
- check output return values in ESC_FLUSH macro
- avoid skewing recursion depth on overflow in ujson_reader
- unescape object ID strings in ujson_reader
- support reading files with zero lseek size such as procfs

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
Andrea Cervesato (15):
      ujson: Fix 4-byte UTF-8 sequence decoding
      ujson: writer: Fix OOB read on invalid UTF-8
      ujson: reader: Prevent infinite loop on EOF
      ujson: writer: Fix open() return value check
      ujson: reader: Combine UTF-16 surrogate pairs
      ujson: reader: Check for signed integer overflow
      ujson: writer: Return error when newline() fails
      ujson: writer: Check return value in ESC_FLUSH
      ujson: reader: Do not increment depth on overflow
      ujson: reader: Parse escape sequences in object IDs
      ujson: reader: Support files with zero lseek size
      ujson: reader: Reject \u0000 escape in strings
      ujson: writer: Set errno when a flush fails
      ujson: writer: Advance buffer on short write
      ujson: writer: Flush buffer before direct writes

 include/ujson_utf.h       |   6 +--
 libs/ujson/ujson_reader.c | 127 ++++++++++++++++++++++++++++++----------------
 libs/ujson/ujson_writer.c |  37 ++++++++++----
 3 files changed, 114 insertions(+), 56 deletions(-)
---
base-commit: 78e6353fdff663b2fc2f77704ceec6c3ca786b96
change-id: 20260925-fix_core_lib_deepseek-2ba9018c7588

Best regards,
--  
Andrea Cervesato <andrea.cervesato@suse.com>



More information about the ltp mailing list