mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.3'
* PHP-8.3: Fix GH-13984: Buffer size is now checked before memcmp (#13991)
This commit is contained in:
@@ -750,7 +750,7 @@ static char *make_filename_safe(const char *filename)
|
||||
}
|
||||
return estrdup(filename);
|
||||
}
|
||||
if (*filename && memcmp(filename, ":memory:", sizeof(":memory:"))) {
|
||||
if (*filename && strcmp(filename, ":memory:")) {
|
||||
char *fullpath = expand_filepath(filename, NULL);
|
||||
|
||||
if (!fullpath) {
|
||||
|
||||
18
ext/pdo_sqlite/tests/gh13991.phpt
Normal file
18
ext/pdo_sqlite/tests/gh13991.phpt
Normal file
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Fix GH-13984: Buffer size is now checked before memcmp
|
||||
--EXTENSIONS--
|
||||
pdo_sqlite
|
||||
--SKIPIF--
|
||||
<?php if (file_exists(getcwd() . '/13991db')) die('skip File "13991db" already exists.'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$dbfile = '13991db';
|
||||
$db = new PDO('sqlite:' . $dbfile, null, null, [PDO::ATTR_PERSISTENT => true]);
|
||||
echo 'done!';
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(getcwd() . '/13991db');
|
||||
?>
|
||||
--EXPECT--
|
||||
done!
|
||||
Reference in New Issue
Block a user