xref: /PHP-8.0/Zend/tests/bug70914.phpt (revision ea03cbeb)
1--TEST--
2Bug #70914 zend_throw_or_error() format string vulnerability
3--SKIPIF--
4<?php
5if (!extension_loaded("pdo_sqlite")) {
6    die("skip pdo_sqlite required");
7}
8?>
9--FILE--
10<?php
11
12$db = new PDO('sqlite::memory:');
13$st = $db->query('SELECT 1');
14try {
15    $re = $st->fetchObject('%Z');
16} catch (TypeError $e) {
17    echo $e->getMessage(), "\n";
18}
19?>
20--EXPECT--
21PDOStatement::fetchObject(): Argument #1 ($class) must be a valid class name, %Z given
22