Re: pgsql: With GB18030, prevent SIGSEGV from reading past end of allocatio - Mailing list pgsql-committers

From Noah Misch
Subject Re: pgsql: With GB18030, prevent SIGSEGV from reading past end of allocatio
Date
Msg-id 20250516031100.8c.nmisch@google.com
Whole thread Raw
In response to Re:pgsql: With GB18030, prevent SIGSEGV from reading past end of allocatio  (sean <zoulx1982@163.com>)
List pgsql-committers
On Wed, May 14, 2025 at 04:38:06PM +0800, sean wrote:
>    I read the patch you commit to pgsql, and i found there also some other routine which
>    will still call pg_encoding_mblen to get char length.
>    I have no idea why these routine don't have to replaced by call pg_encoding_mblen_or_incomplete?

See the pg_encoding_mblen() header comment for the rules on when calling it is
okay.  For example, it's okay for NUL-terminated input.

>     And how can i do to reproduce this crash?

The patch-added test cases provide some indication on how to reproduce the
crash.



pgsql-committers by date:

Previous
From: Richard Guo
Date:
Subject: pgsql: Fix Assert failure in XMLTABLE parser
Next
From: Daniel Gustafsson
Date:
Subject: pgsql: Align organization wording in copyright statement