From 743e453c169f003bd94b066baffcc1cedfc5499e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 25 Jun 2019 12:20:40 +0200 Subject: test build for upcoming 2.5.0 --- ...ix-segfault-in-013.solrclient_getByIds.sh.patch | 53 ---------------------- 1 file changed, 53 deletions(-) delete mode 100644 0005-fix-segfault-in-013.solrclient_getByIds.sh.patch (limited to '0005-fix-segfault-in-013.solrclient_getByIds.sh.patch') diff --git a/0005-fix-segfault-in-013.solrclient_getByIds.sh.patch b/0005-fix-segfault-in-013.solrclient_getByIds.sh.patch deleted file mode 100644 index 109b604..0000000 --- a/0005-fix-segfault-in-013.solrclient_getByIds.sh.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 9c0e23403876814f2812b4bad04989873194c91f Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Fri, 12 Oct 2018 14:10:54 +0200 -Subject: [PATCH 5/5] fix segfault in 013.solrclient_getByIds.sh - ---- - src/php7/php_solr_client.c | 26 ++++++++++++++------------ - 1 file changed, 14 insertions(+), 12 deletions(-) - -diff --git a/src/php7/php_solr_client.c b/src/php7/php_solr_client.c -index 3c76f52..8bad5df 100644 ---- a/src/php7/php_solr_client.c -+++ b/src/php7/php_solr_client.c -@@ -1346,22 +1346,24 @@ PHP_METHOD(SolrClient, getByIds) - - solr_string_init(&query_string); - solr_string_appends(&query_string, "ids=", sizeof("ids=")-1); -- SOLR_HASHTABLE_FOR_LOOP(ids) -- { -- zval *id_zv = NULL; -- id_zv = zend_hash_get_current_data(ids); -- if (Z_TYPE_P(id_zv) == IS_STRING && Z_STRLEN_P(id_zv)) { -- solr_string_appends(&query_string, Z_STRVAL_P(id_zv), Z_STRLEN_P(id_zv)); -- solr_string_appendc(&query_string, ','); -- } else { -- invalid_param = 1; -- goto solr_getbyids_exit; -+ -+ if (ids->nNumOfElements) { -+ SOLR_HASHTABLE_FOR_LOOP(ids) -+ { -+ zval *id_zv = NULL; -+ id_zv = zend_hash_get_current_data(ids); -+ if (Z_TYPE_P(id_zv) == IS_STRING && Z_STRLEN_P(id_zv)) { -+ solr_string_appends(&query_string, Z_STRVAL_P(id_zv), Z_STRLEN_P(id_zv)); -+ solr_string_appendc(&query_string, ','); -+ } else { -+ invalid_param = 1; -+ goto solr_getbyids_exit; -+ } -+ current_position++; - } -- current_position++; - } - - -- - solr_getbyids_exit: - if (invalid_param) { - solr_string_free(&query_string); --- -2.14.4 - -- cgit