Skip to content

Commit

Permalink
Avoid defaulting the final $flags argument to null
Browse files Browse the repository at this point in the history
The correct default for the $flags argument is 0, not null. Passing a
null causes a warning.
  • Loading branch information
kovshenin committed Oct 15, 2024
1 parent 4516944 commit e937403
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion agent/php_mysqli.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,13 @@ static nr_status_t nr_php_mysqli_link_real_connect(
ADD_IF_STR_SET(argv, argc, metadata->database);
ADD_IF_INT_SET(argv, argc, metadata->port);
ADD_IF_STR_SET(argv, argc, metadata->socket);
ADD_IF_INT_SET(argv, argc, metadata->flags);

/*
* Avoid defaulting the final $flags argument to null.
*/
if (metadata->flags) {
ADD_IF_INT_SET(argv, argc, metadata->flags);
}
}

retval = nr_php_call_user_func(link, "real_connect", argc, argv TSRMLS_CC);
Expand Down

0 comments on commit e937403

Please sign in to comment.