php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41347 checkdnsrr() segfaults on empty hostname
Submitted: 2007-05-10 09:35 UTC Modified: 2007-05-23 13:49 UTC
From: spheroid@php.net Assigned:
Status: Closed Package: Network related
PHP Version: 5.2.2 OS: Mac OS X 10.4.9
Private report: No CVE-ID: None
 [2007-05-10 09:35 UTC] spheroid@php.net
Description:
------------
checkdnsrr() should return FALSE on error, but it segfaults if host 
argument is an empty string.

Reproduce code:
---------------
php -r 'var_dump(checkdnsrr("", "A"));'

Expected result:
----------------
bool(false)

Actual result:
--------------
zsh: bus error  php -r 'var_dump(checkdnsrr("", "A"));'

---

(gdb) run -r 'var_dump(checkdnsrr("", "A"));'
Starting program: /usr/local/bin/php -r 'var_dump(checkdnsrr("", "A"));'
Reading symbols for shared libraries .+++..+++++..++++.. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x901174ed in res_send ()


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-10 12:18 UTC] scottmac@php.net
Can you try the patch at http://server.macvicar.net/downloads/php/bug41347.patch.txt

Also does dns_get_mx segfault too?
 [2007-05-10 13:17 UTC] scottmac@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2007-05-18 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2007-05-23 13:49 UTC] spheroid@php.net
Works with 5.2.3-dev.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 11:01:28 2024 UTC