ASCII Null control character validation

From: Alexey Chernyshov <a(dot)chernyshov(at)postgrespro(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: ASCII Null control character validation
Date: 2017-11-30 08:13:07
Message-ID: 20171130111307.550638eb@PostgresPro-A-Chernyshov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello, hackers!

I found in src/backend/utils/mb/wchar.c: pg_verify_mbstr_len() that it
reports ASCII Null character (\000) as invalid. As for me, it should
pass validation. However, ASCII Null character breaks a line and the
end of the line is missed, try:

INSERT INTO mytable VALUES (E'a\001b\000c and rest of line MIA');

Find patch attached. Am I wrong?

--
Alexey Chernyshov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
0001-Fix-0x00-symbol-validation.patch text/x-patch 1.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2017-11-30 08:33:53 Re: [HACKERS] create_unique_path and GEQO
Previous Message David Rowley 2017-11-30 06:50:54 Re: [HACKERS] Removing LEFT JOINs in more cases