php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71853 SolrClient::deleteByIds Segfaults with invalid ids
Submitted: 2016-03-18 14:15 UTC Modified: 2016-03-18 14:16 UTC
From: omars@php.net Assigned: omars (profile)
Status: Closed Package: solr (PECL)
PHP Version: 5.6.19 OS: *
Private report: No CVE-ID: None
 [2016-03-18 14:15 UTC] omars@php.net
Description:
------------
Segfaults when ID is not valid

Test script:
---------------
<?php
require_once "bootstrap.inc";

$options = array
(
    'hostname' => SOLR_SERVER_HOSTNAME,
    'login'    => SOLR_SERVER_USERNAME,
    'password' => SOLR_SERVER_PASSWORD,
    'port'     => SOLR_SERVER_PORT,
    'path'     => SOLR_SERVER_PATH
);

$client = new SolrClient($options);

try {
	$client->deleteByIds(array(0));	
} catch (SolrIllegalArgumentException $e) {
	echo sprintf("Exception %d: %s", $e->getCode(), $e->getMessage()). PHP_EOL;
}

try {
	$client->deleteByIds(array('334455', ''));
} catch (SolrIllegalArgumentException $e) {
	echo sprintf("Exception %d: %s", $e->getCode(), $e->getMessage()). PHP_EOL;
}

Expected result:
----------------
Exception 4000: Id number 1 is not a valid string
Exception 4000: Id number 2 is not a valid string

Actual result:
--------------
Segmentation fault (core dumped)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-18 14:16 UTC] omars@php.net
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: omars
 [2016-03-18 14:19 UTC] omars@php.net
Automatic comment on behalf of omars
Revision: http://git.php.net/?p=pecl/search_engine/solr.git;a=commit;h=2caf3fecf4cf48fd04597f673a2dc4f3e37b41b9
Log: Fix Bug #71853 SolrClient::deleteByIds Segfaults with invalid ids
 [2016-03-18 14:19 UTC] omars@php.net
-Status: Analyzed +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC