pgcrypto: fix memory leak in openssl.c

Поиск
Список
Период
Сортировка
От Marko Kreen
Тема pgcrypto: fix memory leak in openssl.c
Дата
Msg-id e51f66da0602171623j7a0d2c96l9b56196a4ffd6549@mail.gmail.com
обсуждение исходный текст
Ответы Re: pgcrypto: fix memory leak in openssl.c  (Neil Conway <neilc@samurai.com>)
Re: pgcrypto: fix memory leak in openssl.c  ("Marko Kreen" <markokr@gmail.com>)
Список pgsql-patches
pgcrypto crypt()/md5 and hmac() leak memory when compiled against
OpenSSL as openssl.c digest ->reset will do two DigestInit calls
against a context.  This happened to work with OpenSSL 0.9.6
but not with 0.9.7+.

Reason for the messy code was that I tried to avoid creating
wrapper structure to transport algorithm info and tried to use
OpenSSL context for it.  The fix is to create wrapper structure.

It also uses newer digest API to avoid memory allocations
on reset with newer OpenSSLs.

Attached are one patch for 7.3, 7.4, 8.0 branches and another
for 8.1 and HEAD.

Thanks to Daniel Blaisdell for reporting it.

--
marko

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: record statement boundaries
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: win codepages 1253, 1254, 1255, 1257 and cleanup