Browse Source

MFH: check for buflen (on FreeBSD _SC_GETGR_R_SIZE_MAX is not implemented)

patch by stas at FreeBSD dot org
experimental/5.2-WITH_DRCP
Antony Dovgal 20 years ago
parent
commit
e0a7362646
  1. 4
      ext/posix/posix.c

4
ext/posix/posix.c

@ -887,6 +887,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);

Loading…
Cancel
Save