|  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: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
39 - 32 = ?
Subscribe to this entry?

 [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-2023 The PHP Group
All rights reserved.
Last updated: Mon Oct 02 21:01:25 2023 UTC