Avoid an odd undefined behavior with memcmp (src/bin/pg_rewind/pg_rewind.c)

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема Avoid an odd undefined behavior with memcmp (src/bin/pg_rewind/pg_rewind.c)
Дата
Msg-id CAEudQAoT7GWNd1v2qgAT4f7chiwvx-GGJXxdHzODXjYkbQYQuw@mail.gmail.com
обсуждение исходный текст
Ответы Re:Avoid an odd undefined behavior with memcmp (src/bin/pg_rewind/pg_rewind.c)
Re: Avoid an odd undefined behavior with memcmp (src/bin/pg_rewind/pg_rewind.c)
Список pgsql-hackers
Hi.

The function *perform_rewind* has an odd undefined behavior.
The function memcmp/, compares bytes to bytes.

IMO, I think that pg_rewind can have a security issue,
if two files are exactly the same, they are considered different.
Because use of structs with padding values is unspecified.

Fix by explicitly initializing with memset to avoid this.

best regards,
Ranier Vilela
Вложения

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

Предыдущее
От: Imran Zaheer
Дата:
Сообщение: Re: errors building on windows using meson
Следующее
От: Dave Page
Дата:
Сообщение: Windows: openssl & gssapi dislike each other