pgsql: Avoid formally-undefined use of memcpy() inhstoreUniquePairs().

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Avoid formally-undefined use of memcpy() inhstoreUniquePairs().
Дата
Msg-id E1eIgLs-0006ze-Is@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Avoid formally-undefined use of memcpy() in hstoreUniquePairs().

hstoreUniquePairs() often called memcpy with equal source and destination
pointers.  Although this is almost surely harmless in practice, it's
undefined according to the letter of the C standard.  Some versions of
valgrind will complain about it, and some versions of libc as well
(cf. commit ad520ec4a).  Tweak the code to avoid doing that.

Noted by Tomas Vondra.  Back-patch to all supported versions because
of the hazard of libc assertions.

Discussion: https://postgr.es/m/bf84d940-90d4-de91-19dd-612e011007f4@fuzzy.cz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d3f4e8a8a78be60f3a971f1f8ef6acc2d0576e5f

Modified Files
--------------
contrib/hstore/hstore_io.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Repair failure with SubPlans in multi-row VALUES lists.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Generational memory allocator