Skip to content

ext/sockets: Use zval_is_true() instead of converting to boolean #18681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ext/sockets/multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ int php_do_setsockopt_ip_mcast(php_socket *php_sock,
goto dosockopt;

case IP_MULTICAST_LOOP:
convert_to_boolean(arg4);
ipv4_mcast_ttl_lback = (unsigned char) (Z_TYPE_P(arg4) == IS_TRUE);
ipv4_mcast_ttl_lback = (unsigned char) zval_is_true(arg4);
goto ipv4_loop_ttl;

case IP_MULTICAST_TTL:
Expand Down Expand Up @@ -358,8 +357,7 @@ int php_do_setsockopt_ipv6_mcast(php_socket *php_sock,
goto dosockopt;

case IPV6_MULTICAST_LOOP:
convert_to_boolean(arg4);
ov = (int) Z_TYPE_P(arg4) == IS_TRUE;
ov = (int) zval_is_true(arg4);
goto ipv6_loop_hops;
case IPV6_MULTICAST_HOPS:
convert_to_long(arg4);
Expand Down