From: linuxtestproject.agent@gmail.com
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] ujson: Fix 4-byte UTF-8 sequence decoding
Date: Tue, 13 Oct 2026 15:42:38 +0000 [thread overview]
Message-ID: <20261013154238.4969-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20261013-fix_core_lib_deepseek-v2-1-7a6670fd6fd6@suse.com>
Hi Andrea,
On 13 October 2026, Andrea Cervesato wrote:
> ujson: Fix 4-byte UTF-8 sequence decoding
--- [PATCH 7/15] ---
> ujson: reader: Check for signed integer overflow
> diff --git a/libs/ujson/ujson_reader.c b/libs/ujson/ujson_reader.c
> + if (sign < 0)
> + res->val_int = -(long)val;
Medium severity: the bound allows LONG_MAX + 1 for negative input, but
-(long)val then negates LONG_MIN, causing signed overflow on both LP64 and
ILP32. Parsing [-9223372036854775808] on LP64 triggers UBSan here. Assign
LONG_MIN directly for that magnitude, or accumulate negative values without
negating LONG_MIN.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-10-13 15:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 12:01 [LTP] [PATCH v2 00/15] Fix ujson bugs Andrea Cervesato
2026-10-13 12:01 ` [LTP] [PATCH v2 01/15] ujson: Fix 4-byte UTF-8 sequence decoding Andrea Cervesato
2026-10-13 15:42 ` linuxtestproject.agent [this message]
2026-10-13 12:01 ` [LTP] [PATCH v2 02/15] ujson: writer: Fix OOB read on invalid UTF-8 Andrea Cervesato
2026-10-13 12:01 ` [LTP] [PATCH v2 03/15] ujson: reader: Prevent infinite loop on EOF Andrea Cervesato
2026-10-13 12:02 ` [LTP] [PATCH v2 04/15] ujson: writer: Fix open() return value check Andrea Cervesato
2026-10-13 12:02 ` [LTP] [PATCH v2 05/15] ujson: reader: Return UTF-8 length when !str Andrea Cervesato
2026-10-13 12:02 ` [LTP] [PATCH v2 06/15] ujson: reader: Combine UTF-16 surrogate pairs Andrea Cervesato
2026-10-13 12:02 ` [LTP] [PATCH v2 07/15] ujson: reader: Check for signed integer overflow Andrea Cervesato
2026-10-13 12:02 ` [LTP] [PATCH v2 08/15] ujson: writer: Return error when newline() fails Andrea Cervesato
2026-10-13 12:02 ` [LTP] [PATCH v2 09/15] ujson: writer: Check return value in esc_flush() Andrea Cervesato
2026-10-13 12:02 ` [LTP] [PATCH v2 10/15] ujson: reader: Parse escape sequences in object IDs Andrea Cervesato
2026-10-13 12:02 ` [LTP] [PATCH v2 11/15] ujson: reader: Reject files with zero size Andrea Cervesato
2026-10-13 12:02 ` [LTP] [PATCH v2 12/15] ujson: reader: Reject \u0000 escape in strings Andrea Cervesato
2026-10-13 12:02 ` [LTP] [PATCH v2 13/15] ujson: writer: Set errno when a flush fails Andrea Cervesato
2026-10-13 12:02 ` [LTP] [PATCH v2 14/15] ujson: writer: Advance buffer on short write Andrea Cervesato
2026-10-13 12:02 ` [LTP] [PATCH v2 15/15] ujson: writer: Flush buffer before direct writes Andrea Cervesato
-- strict thread matches above, loose matches on Subject: below --
2026-10-05 13:25 [LTP] [PATCH 03/15] ujson: reader: Prevent infinite loop on EOF Andrea Cervesato
2026-10-05 18:06 ` [LTP] ujson: Fix 4-byte UTF-8 sequence decoding linuxtestproject.agent
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261013154238.4969-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=andrea.cervesato@suse.de \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox