Re: Fix memcmp() with different sizes.
От
Tom Lane
Тема
Re: Fix memcmp() with different sizes.
Дата
Msg-id
9475.1075775266@sss.pgh.pa.us
Ответ на
Fix memcmp() with different sizes. (Kurt Roeckx)
Список
Дерево обсуждения
Fix memcmp() with different sizes. Kurt Roeckx <Q@ping.be>
Re: Fix memcmp() with different sizes. Tom Lane <tgl@sss.pgh.pa.us>
Re: Fix memcmp() with different sizes. Kurt Roeckx <Q@ping.be>
Re: Fix memcmp() with different sizes. Tom Lane <tgl@sss.pgh.pa.us>
Kurt Roeckx writes: > - if (memcmp(re_array[i].cre_pat, text_re, text_re_len) == 0 && > + if (VARSIZE(re_array[i].cre_pat) == text_re_len && > + memcmp(re_array[i].cre_pat, text_re, text_re_len) == 0 && This is not actually broken. The first four bytes of what memcmp is comparing are the length, and so it'll fall out immediately anyway if the lengths differ. regards, tom lane
В списке pgsql-patches по дате отправления
От: Claudio Natoli
Дата: