summaryrefslogtreecommitdiff
path: root/user/php7/pwbuflen.patch
blob: 7d2685b55b8fc7659e0b85eaf08e658350f761de (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sysconf(_SC_GETPW_R_SIZE_MAX) returns -1 on musl and 1024 on glibc.

--- php-7.2.6/main/main.c	2018-06-04 23:30:18.790089810 -0400
+++ php-7.2.6/main/main.c	2018-06-04 23:30:14.660089806 -0400
@@ -1315,7 +1315,9 @@
 		int pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
 		char *pwbuf;
 
-		if (pwbuflen < 1) {
+		if (pwbuflen == -1) {
+			pwbuflen = 1024;
+		} else if (pwbuflen < 1) {
 			return "";
 		}
 		pwbuf = emalloc(pwbuflen);