ext/sockets: socket_strerror follow-up on GH-16267 fix.

boundaries should be INT_MIN <= val < INT_MAX in fact.

close GH-16891
This commit is contained in:
David Carlier 2024-11-28 13:00:42 +00:00
parent 3702f9783b
commit 3bea6a2ddb
No known key found for this signature in database
GPG key ID: 8486F847B4B94EF1
3 changed files with 14 additions and 10 deletions

View file

@ -354,7 +354,11 @@ char *sockets_strerror(int error) /* {{{ */
#ifndef PHP_WIN32
if (error < -10000) {
error = -error - 10000;
if (error == INT_MIN) {
error = 2147473648;
} else {
error = -error - 10000;
}
#ifdef HAVE_HSTRERROR
buf = hstrerror(error);