From eb6714ed7269340be56a96d5cb80e3e34cee3051 Mon Sep 17 00:00:00 2001 From: viest Date: Thu, 21 Nov 2019 17:49:53 +0800 Subject: [PATCH 1/2] Fix: sheet call back value is null --- kernel/read.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/read.c b/kernel/read.c index f962ea4..1ff4136 100644 --- a/kernel/read.c +++ b/kernel/read.c @@ -290,6 +290,11 @@ int sheet_cell_callback (size_t row, size_t col, const char *value, void *callba ZVAL_LONG(&args[0], (row - 1)); ZVAL_LONG(&args[1], (col - 1)); + if (value == NULL) { + ZVAL_NULL(&args[2]); + goto CALL_USER_FUNCTION; + } + if (Z_TYPE_P(_callback_data->zv_type_t) != IS_ARRAY) { zend_long _long = 0; double _double = 0; @@ -318,6 +323,8 @@ int sheet_cell_callback (size_t row, size_t col, const char *value, void *callba data_to_custom_type(value, _type, &args[2]); } + CALL_USER_FUNCTION: + zend_call_function(_callback_data->fci, _callback_data->fci_cache); zval_ptr_dtor(&args[2]); From 1892c050a170ffbfaa805fbc406a37df256affc3 Mon Sep 17 00:00:00 2001 From: viest Date: Thu, 21 Nov 2019 17:52:43 +0800 Subject: [PATCH 2/2] Fix: sheet call back value is null --- kernel/read.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/read.c b/kernel/read.c index 1ff4136..f330789 100644 --- a/kernel/read.c +++ b/kernel/read.c @@ -289,9 +289,9 @@ int sheet_cell_callback (size_t row, size_t col, const char *value, void *callba ZVAL_LONG(&args[0], (row - 1)); ZVAL_LONG(&args[1], (col - 1)); + ZVAL_NULL(&args[2]); if (value == NULL) { - ZVAL_NULL(&args[2]); goto CALL_USER_FUNCTION; } @@ -319,7 +319,6 @@ int sheet_cell_callback (size_t row, size_t col, const char *value, void *callba } } - ZVAL_NULL(&args[2]); data_to_custom_type(value, _type, &args[2]); }