php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59094 Crash when trying to access empty field
Submitted: 2010-03-02 09:12 UTC Modified: 2010-03-02 12:08 UTC
From: koenk82 at gmail dot com Assigned:
Status: Closed Package: solr (PECL)
PHP Version: 5.3.1 OS: Windows 7
Private report: No CVE-ID: None
 [2010-03-02 09:12 UTC] koenk82 at gmail dot com
Description:
------------
I've used the php_solr.dll file from windows.php.net, which is version 0.9.7.

When doing getResponse() on the SolrQueryResponse object PHP seems to crash when it contains an empty field.

When var_dump'ing the query response the empty field looks like:
<str name="s_full_description"/>

When filling the field, the problem doesn't occur, so the response contains this:
<str name="s_full_description">something</str>

Reproduce code:
---------------
// make sure there's a field with no data
$document->addField('s_short_description', '');

// retrieve the field
$options = array( ... );
$client = new SolrClient($options);
$query = new SolrQuery();
$results = $query->setQuery('*:*');
$query->setStart(0);
$query->setRows(10);
$query->addField('id');
$query->addField('s_full_description'); // when leaving this out, it works correctly
$queryResponse = $client->query($query);
$response = $queryResponse->getResponse(); // makes it crash

Expected result:
----------------
not to crash

Actual result:
--------------
php stopped working

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-02 12:08 UTC] iekpo@php.net
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/solr

This issue was fixed in release 0.9.8 or SVN revision 291171

Once we get the windows version up to date you should be fine.

I will try to get that in place within the next week or so.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC