This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 2/3] nss: Handle nss_parse_service_list out of memory case
- From: Jiri Olsa <jolsa at redhat dot com>
- To: libc-alpha at sourceware dot org
- Cc: drepper at gmail dot com
- Date: Thu, 15 Sep 2011 15:56:32 +0200
- Subject: [PATCH 2/3] nss: Handle nss_parse_service_list out of memory case
- References: <1316094993-8086-1-git-send-email-jolsa@redhat.com>
The nss_parse_service_list function called from __nss_database_lookup
can fail with out of memory error. We need to return an error in this
case to notify callers.
---
2011-09-15 Jiri Olsa <jolsa@redhat.com>
* nss/nsswitch.c (__nss_database_lookup): Handle
nss_parse_service_list out of memory case.
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index 3d14ae3..2646d9a 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -147,7 +147,7 @@ __nss_database_lookup (const char *database, const char *alternate_name,
__libc_lock_unlock (lock);
- return 0;
+ return *ni != NULL ? 0 : -1;
}
libc_hidden_def (__nss_database_lookup)
--
1.7.4.4