Skip to content

Commit

Permalink
Fix crash in unsuccessful uses of nss_db
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Jun 21, 2011
1 parent c0244a9 commit 51f9aa6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
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]
* sysdeps/posix/getaddrinfo.c (gaih_inet): When looking up only IPv6
addresses using gethostbyname4_r ignore IPv4 addresses.
Expand Down
11 changes: 7 additions & 4 deletions nss/nss_db/db-XXX.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ CONCAT(_nss_db_set,ENTNAME) (int stayopen)

status = internal_setent (DBFILE, &state);

/* Remember STAYOPEN flag. */
if (status == NSS_STATUS_SUCCESS)
keep_db |= stayopen;
/* Reset the sequential index. */
entidx = (const char *) state.header + state.header->valstroffset;
{
/* Remember STAYOPEN flag. */
keep_db |= stayopen;

/* Reset the sequential index. */
entidx = (const char *) state.header + state.header->valstroffset;
}

__libc_lock_unlock (lock);

Expand Down

0 comments on commit 51f9aa6

Please sign in to comment.