xref: /PHP-8.4/ext/curl/tests/bug68089.phpt (revision 8567bc10)
1--TEST--
2Bug #68089 (NULL byte injection - cURL lib)
3--EXTENSIONS--
4curl
5--FILE--
6<?php
7$url = "file:///etc/passwd\0http://google.com";
8$ch = curl_init();
9
10try {
11    curl_setopt($ch, CURLOPT_URL, $url);
12} catch (ValueError $exception) {
13    echo $exception->getMessage() . "\n";
14}
15
16?>
17Done
18--EXPECT--
19curl_setopt(): cURL option must not contain any null bytes
20Done
21