Skip to content

Commit 6d91093

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

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
var_dump($host);
11+
12+
try {
13+
$url->withHost($host);
14+
} catch (Throwable $e) {
15+
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
16+
}
17+
18+
?>
19+
--EXPECT--
20+
Uri\WhatWg\InvalidUrlException: The specified host is malformed (DomainInvalidCodePoint)

0 commit comments

Comments
 (0)