Windows port minor fixes

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема Windows port minor fixes
Дата
Msg-id CO2PR05MB262934E06BE4C71599508B17E3510@CO2PR05MB2629.namprd05.prod.outlook.com
обсуждение исходный текст
Ответы Re: Windows port minor fixes  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
Список pgsql-hackers
Hi,

According to microsoft documentation at:
https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom
The function CryptGenRandom is deprecated, and may can be removed in future release.
Considering that postgres only supports windows versions that have the new API, it would be good to make the replace.

BCryptGenRandom apparently works without having to set up an environment before calling it, allowing a simplification
inthe file that makes the call. 
The drawback, its change causes need to link to bcrypt.lib.

On exec.c, have two memory leaks, and a possible access beyond heap bounds, the patch tries to fix them.
According to documentation at:
https://en.cppreference.com/w/c/experimental/dynamic/strdup
"The returned pointer must be passed to free to avoid a memory leak. "

* memory leak fix to src/common/exec.c
* CryptGenRandom change by BCryptGenRandom to src/port/pg_strong_random.c
* link bcrypt.lib to src/tools/msvc/Mkvcbuild.pm

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

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

Предыдущее
От: Tomas Zubiri
Дата:
Сообщение: Re: Improvement to psql's connection defaults
Следующее
От: Justin Pryzby
Дата:
Сообщение: ERROR: could not resize shared memory segment...No space left ondevice