Skip to content

Commit 94cfc0d

Browse files
committed
Buffer size is now checked before memcmp
1 parent 093d334 commit 94cfc0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/pdo_sqlite/sqlite_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ static char *make_filename_safe(const char *filename)
751751
}
752752
return estrdup(filename);
753753
}
754-
if (*filename && memcmp(filename, ":memory:", sizeof(":memory:"))) {
754+
if (*filename && (sizeof(filename) != sizeof(":memory:") || memcmp(filename, ":memory:", sizeof(":memory:")) != 0)) {
755755
char *fullpath = expand_filepath(filename, NULL);
756756

757757
if (!fullpath) {

0 commit comments

Comments
 (0)