summaryrefslogtreecommitdiffstats
path: root/sss_client/passwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sss_client/passwd.c')
-rw-r--r--sss_client/passwd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sss_client/passwd.c b/sss_client/passwd.c
index e999e5dd5..0d70b6843 100644
--- a/sss_client/passwd.c
+++ b/sss_client/passwd.c
@@ -180,6 +180,9 @@ enum nss_status _nss_sss_getpwnam_r(const char *name, struct passwd *result,
enum nss_status nret;
int ret;
+ /* Caught once glibc passing in buffer == 0x0 */
+ if (!buffer || !buflen) return ERANGE;
+
rd.len = strlen(name) + 1;
rd.data = name;
@@ -227,6 +230,9 @@ enum nss_status _nss_sss_getpwuid_r(uid_t uid, struct passwd *result,
uint32_t user_uid;
int ret;
+ /* Caught once glibc passing in buffer == 0x0 */
+ if (!buffer || !buflen) return ERANGE;
+
user_uid = uid;
rd.len = sizeof(uint32_t);
rd.data = &user_uid;
@@ -294,6 +300,9 @@ enum nss_status _nss_sss_getpwent_r(struct passwd *result,
uint32_t num_entries;
int ret;
+ /* Caught once glibc passing in buffer == 0x0 */
+ if (!buffer || !buflen) return ERANGE;
+
/* if there are leftovers return the next one */
if (sss_nss_getpwent_data.data != NULL &&
sss_nss_getpwent_data.ptr < sss_nss_getpwent_data.len) {