diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2013-04-28 15:14:21 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2013-04-28 15:14:21 +0200 |
commit | 6216a13555696de61620f89aa1c597999b41214b (patch) | |
tree | d932d05d6c4067d3345cc06df724ddb73e3438d3 | |
parent | 4950877425af884a35ecbc272a6b77a5e5602413 (diff) |
return NSS_STATUS_TRYAGAIN on zero-length (but not-NULL) buffer (thanks Jakub Hrozek) (f21efd6 from 0.9)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-0.8@1944 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | nss/common.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nss/common.h b/nss/common.h index b75f4a4..e8d8e05 100644 --- a/nss/common.h +++ b/nss/common.h @@ -86,10 +86,15 @@ /* check validity of passed buffer (Glibc flavour) */ #define NSS_BUFCHECK \ - if ((buffer==NULL)||(buflen==0)) \ + if (buffer==NULL) \ { \ *errnop=EINVAL; \ return NSS_STATUS_UNAVAIL; \ + } \ + if (buflen==0) \ + { \ + *errnop=ERANGE; \ + return NSS_STATUS_TRYAGAIN; \ } #endif /* NSS_FLAVOUR_GLIBC */ |