Skip to content

Commit 4003833

Browse files
committed
Try to reproduce GH-20668
1 parent c24d51e commit 4003833

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
GH-20668 lobal buffer overflow in url.c
3+
--FILE--
4+
<?php
5+
6+
$str = 'file:///datafoo:test';
7+
$url = Uri\WhatWg\Url::parse($str);
8+
$host = $url->getAsciiHost();
9+
10+
try {
11+
$url->withHost($host);
12+
} catch (Throwable $e) {
13+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
14+
}
15+
16+
?>
17+
--EXPECT--
18+
Uri\WhatWg\InvalidUrlException: The specified host is malformed (DomainInvalidCodePoint)

0 commit comments

Comments
 (0)