mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-07 06:43:00 +03:00
Fix crash in unsuccessful uses of nss_db
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
2011-06-21 Ulrich Drepper <drepper@gmail.com>
|
2011-06-21 Ulrich Drepper <drepper@gmail.com>
|
||||||
|
|
||||||
|
* nss/nss_db/db-XXX.c (nss_db_setENT): Only set entidx for successful
|
||||||
|
calls to internal_setent.
|
||||||
|
|
||||||
[BZ #12885]
|
[BZ #12885]
|
||||||
* sysdeps/posix/getaddrinfo.c (gaih_inet): When looking up only IPv6
|
* sysdeps/posix/getaddrinfo.c (gaih_inet): When looking up only IPv6
|
||||||
addresses using gethostbyname4_r ignore IPv4 addresses.
|
addresses using gethostbyname4_r ignore IPv4 addresses.
|
||||||
|
@@ -71,11 +71,14 @@ CONCAT(_nss_db_set,ENTNAME) (int stayopen)
|
|||||||
|
|
||||||
status = internal_setent (DBFILE, &state);
|
status = internal_setent (DBFILE, &state);
|
||||||
|
|
||||||
/* Remember STAYOPEN flag. */
|
|
||||||
if (status == NSS_STATUS_SUCCESS)
|
if (status == NSS_STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
/* Remember STAYOPEN flag. */
|
||||||
keep_db |= stayopen;
|
keep_db |= stayopen;
|
||||||
|
|
||||||
/* Reset the sequential index. */
|
/* Reset the sequential index. */
|
||||||
entidx = (const char *) state.header + state.header->valstroffset;
|
entidx = (const char *) state.header + state.header->valstroffset;
|
||||||
|
}
|
||||||
|
|
||||||
__libc_lock_unlock (lock);
|
__libc_lock_unlock (lock);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user