This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCHv2 2/3] nss: Handle nss_parse_service_list out of memory case
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-25 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 7f8900e..269152f 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