Bug #81400 [NEW]: Unterminated string in dns_get_record() results on Windows
| From: | cmb@php.net | Date: | Mon, 30 Aug 2021 14:08:45 +0000 |
| Subject: | Bug #81400 [NEW]: Unterminated string in dns_get_record() results on Windows | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-236176@lists.php.net to get a copy of this message | ||
From: cmb
Operating system: Windows
PHP version: 7.4Git-2021-08-30 (Git)
Package: Network related
Bug Type: Bug
Bug description:Unterminated string in dns_get_record() results on Windows
Description:
------------
On Windows, dns_get_record(â¦)[$i]["txt"] is always unterminated
(if that element exists). This can lead to serious issues if that
string is passed to some other functions.
Test script:
---------------
$result = dns_get_record("php.net", DNS_TXT);
print_r($result[0]);
Expected result:
----------------
Array
(
[host] => php.net
[class] => IN
[ttl] => 300
[type] => TXT
[txt] => v=spf1 ip4:72.52.91.12 ip6:2a02:cb41::8 ip4:140.211.15.143
ip4:208.43.231.12 ip4:45.112.84.5 ip4:142.93.197.176
ip6:2604:a880:400:d0::1c74:1001 ip6:2a02:cb43:8000::1102 ?all
[entries] => Array
(
[0] => v=spf1 ip4:72.52.91.12 ip6:2a02:cb41::8
ip4:140.211.15.143 ip4:208.43.231.12
ip4:45.112.84.5 ip4:142.93.197.176 ip6:2604:a880:400:d0::1c74:1001
ip6:2a02:cb43:8000::1102 ?all )
)
Actual result:
--------------
Array
(
[host] => php.net
[class] => IN
[ttl] => 300
[type] => TXT
[txt] => v=spf1 ip4:72.52.91.12 ip6:2a02:cb41::8 ip4:140.211.15.143
ip4:208.43.231.12 ip4:45.112.84.5 ip4:142.93.197.176
ip6:2604:a880:400:d0::1c74:1001 ip6:2a02:cb43:8000::1102 ?all
[entries] => Array
(
[0] => v=spf1 ip4:72.52.91.12 ip6:2a02:cb41::8
ip4:140.211.15.143 ip4:208.43.231.12
ip4:45.112.84.5 ip4:142.93.197.176 ip6:2604:a880:400:d0::1c74:1001
ip6:2a02:cb43:8000::1102 ?all )
)
Warning: String is not zero-terminated (v=spf1 ip4:72.52.91.12
ip6:2a02:cb41::8 ip4:140.211.15.143 ip4:208.43.231.12 ip4:45.112.84.5
ip4:142.93.197.176 ip6:2604:a880:400:d0::1c74:1001
ip6:2a02:cb43:8000::1102 ?all) in Unknown on line 0
--
Edit bug report at https://bugs.php.net/bug.php?id=81400&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81400&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81400&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81400&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81400&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81400&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81400&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81400&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81400&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81400&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81400&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81400&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81400&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81400&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81400&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81400&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81400&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81400&r=mysqlcfg