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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user