Skip to content

Replace mblen() with bounds-checked versions.#32

Open
MasahikoSawada wants to merge 1 commit into
pgbigm:masterfrom
MasahikoSawada:fix_mblen
Open

Replace mblen() with bounds-checked versions.#32
MasahikoSawada wants to merge 1 commit into
pgbigm:masterfrom
MasahikoSawada:fix_mblen

Conversation

@MasahikoSawada

Copy link
Copy Markdown
Contributor

Malformed or corrupted strings could cause code iterating with pg_mblen() to overrun its buffer. This commit replaces calls to pg_mblen() and t_isspace() with bounds-checked versions, such as pg_mblen_with_len() and t_isspace_with_len().

For backward compatibility with legacy releases (PostgreSQL 13 and earlier), provide shims that map these new APIs to the traditional un-checked implementations.

Inspired by pg_trgm changes in commit 319e8a64419a.

Malformed or corrupted strings could cause code iterating with
pg_mblen() to overrun its buffer. This commit replaces calls to
pg_mblen() and t_isspace() with bounds-checked versions, such as
pg_mblen_with_len() and t_isspace_with_len().

For backward compatibility with legacy releases (PostgreSQL 13 and
earlier), provide shims that map these new APIs to the traditional
un-checked implementations.

Inspired by pg_trgm changes in commit 319e8a64419a.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant