Skip to content

Commit 92d8dd6

Browse files
committed
wip
1 parent 093d334 commit 92d8dd6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/pdo_sqlite/sqlite_driver.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ static void pdo_sqlite_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *
8989

9090
if (einfo->errcode) {
9191
add_next_index_long(info, einfo->errcode);
92-
add_next_index_string(info, einfo->errmsg);
92+
if (strlen(einfo->errmsg) > 0) {
93+
add_next_index_string(info, einfo->errmsg);
94+
}
9395
}
9496
}
9597

@@ -751,7 +753,7 @@ static char *make_filename_safe(const char *filename)
751753
}
752754
return estrdup(filename);
753755
}
754-
if (*filename && memcmp(filename, ":memory:", sizeof(":memory:"))) {
756+
if (*filename && zend_binary_strcmp(filename, strlen(filename), ":memory:", strlen(":memory:"))) {
755757
char *fullpath = expand_filepath(filename, NULL);
756758

757759
if (!fullpath) {

0 commit comments

Comments
 (0)