Re: BUG #17788: Incorrect memory access when parsing empty string as sql_standard interval
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: BUG #17788: Incorrect memory access when parsing empty string as sql_standard interval |
| Дата | |
| Msg-id | 907585.1676224419@sss.pgh.pa.us обсуждение |
| Ответ на | BUG #17788: Incorrect memory access when parsing empty string as sql_standard interval (PG Bug reporting form <noreply@postgresql.org>) |
| Список | pgsql-bugs |
PG Bug reporting form <noreply@postgresql.org> writes:
> When executing under valgrind:
> SET IntervalStyle TO sql_standard;
> SELECT ''::interval;
> The following error is detected:
> ==00:00:00:03.574 1155861== Use of uninitialised value of size 8
> ==00:00:00:03.574 1155861== at 0x606ADE: DecodeInterval
> (datetime.c:3368)
Good catch! For me, it dumps core about half the time even without
using valgrind.
> This defect was introduced by the commit e39f9904.
> Before that commit the check
> if (IntervalStyle == INTSTYLE_SQL_STANDARD && *field[0] == '-')
> was guarded by
> if (fmask == 0)
> return DTERR_BAD_FORMAT;
> but now field[0] is accessed unconditionally (even when nf == 0) for the
> SQL_STANDARD style.
Right. Not checking nf > 0 wasn't great style there in any case,
but it accidentally failed to fail before.
Fix pushed --- thanks for the report!
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера