Обсуждение: pgsql: Minor fix for LDAP authentication: if an error occurs, we need to

Поиск
Список
Период
Сортировка

pgsql: Minor fix for LDAP authentication: if an error occurs, we need to

От
neilc@postgresql.org (Neil Conway)
Дата:
Log Message:
-----------
Minor fix for LDAP authentication: if an error occurs, we need to
manually release the LDAP handle via ldap_unbind(). This isn't a
significant problem in practice because an error eventually results
in exiting the process, but we can cleanup correctly without too
much pain.

In passing, fix an error in snprintf() usage: the "size" parameter
to snprintf() is the size of the destination buffer, including space
for the NUL terminator. Also, depending on the value of NAMEDATALEN,
the old coding could have allowed for a buffer overflow.

Modified Files:
--------------
    pgsql/src/backend/libpq:
        auth.c (r1.145 -> r1.146)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/libpq/auth.c.diff?r1=1.145&r2=1.146)