mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.1'
* PHP-8.1: Fix GH-9032: SQLite3 authorizer crashes on NULL values
This commit is contained in:
commit
a398a2fd3d
4 changed files with 57 additions and 1 deletions
|
@ -738,6 +738,9 @@ static const struct pdo_dbh_methods sqlite_methods = {
|
|||
|
||||
static char *make_filename_safe(const char *filename)
|
||||
{
|
||||
if (!filename) {
|
||||
return NULL;
|
||||
}
|
||||
if (*filename && strncasecmp(filename, "file:", 5) == 0) {
|
||||
if (PG(open_basedir) && *PG(open_basedir)) {
|
||||
return NULL;
|
||||
|
@ -766,7 +769,7 @@ static int authorizer(void *autharg, int access_type, const char *arg3, const ch
|
|||
char *filename;
|
||||
switch (access_type) {
|
||||
case SQLITE_ATTACH: {
|
||||
filename = make_filename_safe(arg3);
|
||||
filename = make_filename_safe(arg3);
|
||||
if (!filename) {
|
||||
return SQLITE_DENY;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue