Skip to content

Commit

Permalink
Bugfix for 1465 (#1471)
Browse files Browse the repository at this point in the history
Adding a NULL check to prevent SEEGFAULT when parameter parsing fails
  • Loading branch information
v-makouz authored and absci committed Aug 31, 2023
1 parent 62beb28 commit 91a916e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions source/sqlsrv/stmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1922,6 +1922,7 @@ zval* parse_param_array(_Inout_ ss_sqlsrv_stmt* stmt, _Inout_ HashTable* param_h

// Assumption: there are more than only the variable, parse the rest of the array
zval* dir = zend_hash_index_find(param_ht, 1);
if(!dir) { throw ss::SSException(); }
if (Z_TYPE_P(dir) != IS_NULL) {
// if param direction is specified, make sure it's valid
CHECK_CUSTOM_ERROR(Z_TYPE_P(dir) != IS_LONG, stmt, SS_SQLSRV_ERROR_INVALID_PARAMETER_DIRECTION, index + 1, NULL) {
Expand Down

0 comments on commit 91a916e

Please sign in to comment.