OSDN Git Service

Minor fix for LDAP authentication: if an error occurs, we need to
authorNeil Conway <neilc@samurai.com>
Mon, 6 Nov 2006 01:27:52 +0000 (01:27 +0000)
committerNeil Conway <neilc@samurai.com>
Mon, 6 Nov 2006 01:27:52 +0000 (01:27 +0000)
commit62fe410ec6cd7811b0cf76c8e175c47daba108d9
tree1bb7e6d12653f94776039f5b52c0ac713f07b3dd
parent76d5667ba853092e31cc258c5b45d5bd04e59298
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.
src/backend/libpq/auth.c