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