|  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: Assigned:
Status: Closed Package: Network related
PHP Version: 5.2.2 OS: Mac OS X 10.4.9
Private report: No CVE-ID:
 [2007-05-10 09:35 UTC]
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:

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 ()


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-10 12:18 UTC]
Can you try the patch at

Also does dns_get_mx segfault too?
 [2007-05-10 13:17 UTC]
Please try using this CVS snapshot:
For Windows:

 [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]
Works with 5.2.3-dev.
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Tue Oct 13 18:01:32 2015 UTC