Skip to content

Commit f8812de

Browse files
authored
Merge pull request #96 from andypost/master
Fix segfault in do_operation handler (ext-decimal 2.0.x)
2 parents d09287c + 5dc78ba commit f8812de

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/decimal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ static php_decimal_success_t php_decimal_do_operation_handler(zend_uchar opcode,
344344
/* Unsupported op type - return success to avoid casting. */
345345
if (UNEXPECTED(op == NULL)) {
346346
php_decimal_operator_not_supported();
347+
ZVAL_UNDEF(result);
347348
return SUCCESS;
348349
}
349350

src/number.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ static php_decimal_success_t php_decimal_number_do_operation(zend_uchar opcode,
108108
/* Unsupported operator - return success to avoid casting. */
109109
if (UNEXPECTED(func == NULL)) {
110110
php_decimal_operator_not_supported();
111+
ZVAL_UNDEF(result);
111112
return SUCCESS;
112113
}
113114

src/rational.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ static php_decimal_success_t php_decimal_rational_do_operation(zend_uchar opcode
354354
/* Unsupported operator - return success to avoid casting. */
355355
if (UNEXPECTED(op == NULL)) {
356356
php_decimal_operator_not_supported();
357+
ZVAL_UNDEF(result);
357358
return SUCCESS;
358359
}
359360

0 commit comments

Comments
 (0)