mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix undefined behavior in php_set_inet6_addr
Postfix `++` on `NULL` is undefined behavior Closes GH-8607
This commit is contained in:
1
NEWS
1
NEWS
@@ -110,6 +110,7 @@ PHP NEWS
|
||||
|
||||
- Sockets:
|
||||
. Fixed Solaris builds. (David Carlier)
|
||||
. Fix undefined behavior in php_set_inet6_addr. (ilutov)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug GH-8121 (SplFileObject - seek and key with csv file inconsistent).
|
||||
|
||||
@@ -60,11 +60,13 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_
|
||||
|
||||
}
|
||||
|
||||
if (scope++) {
|
||||
if (scope) {
|
||||
zend_long lval = 0;
|
||||
double dval = 0;
|
||||
unsigned scope_id = 0;
|
||||
|
||||
scope++;
|
||||
|
||||
if (IS_LONG == is_numeric_string(scope, strlen(scope), &lval, &dval, 0)) {
|
||||
if (lval > 0 && (zend_ulong)lval <= UINT_MAX) {
|
||||
scope_id = lval;
|
||||
|
||||
Reference in New Issue
Block a user