Skip to content

Commit 2dd67ab

Browse files
committed
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: Fixed Bug #64949 (Buffer overflow in _pdo_pgsql_error)
2 parents 8b515fa + 1c623e3 commit 2dd67ab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎ext/pdo_pgsql/pgsql_driver.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *
7676
einfo->errmsg = NULL;
7777
}
7878

79-
if (sqlstate == NULL) {
79+
if (sqlstate == NULL || strlen(sqlstate) >= sizeof(pdo_error_type)) {
8080
strcpy(*pdo_err, "HY000");
8181
}
8282
else {

0 commit comments

Comments
 (0)