1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 10:12:18 +01:00

check for buflen (on FreeBSD _SC_GETGR_R_SIZE_MAX is not implemented)

patch by stas at FreeBSD dot org
This commit is contained in:
Antony Dovgal
2007-02-22 23:40:25 +00:00
parent bbfce40c49
commit 65b54baac4

View File

@@ -885,6 +885,10 @@ PHP_FUNCTION(posix_getgrgid)
#if defined(ZTS) && defined(HAVE_GETGRGID_R) && defined(_SC_GETGR_R_SIZE_MAX)
grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
if (grbuflen < 1) {
RETURN_FALSE;
}
grbuf = emalloc(grbuflen);
ret = getgrgid_r(gid, &_g, grbuf, grbuflen, &retgrptr);