pgsql: Avoid possibly accessing off the end of memory in SJIS2004 conve

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Avoid possibly accessing off the end of memory in SJIS2004 conve
Дата
Msg-id E1R10m1-0000hF-9Y@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Avoid possibly accessing off the end of memory in SJIS2004 conversion.

The code in shift_jis_20042euc_jis_2004() would fetch two bytes even when
only one remained in the string.  Since conversion functions aren't
supposed to assume null-terminated input, this poses a small risk of
fetching past the end of memory and incurring SIGSEGV.  No such crash has
been identified in the field, but we've certainly seen the equivalent
happen in other code paths, so patch this one all the way back.

Report and patch by Noah Misch.

Branch
------
REL8_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/b2658c348eeb12d4cf87c21e05ddb5d97e4f043b

Modified Files
--------------
.../euc_jis_2004_and_shift_jis_2004.c              |    8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Avoid possibly accessing off the end of memory in SJIS2004 conve
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Avoid possibly accessing off the end of memory in SJIS2004 conve