diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-09-25 11:25:02 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-09-25 13:51:18 +0200 |
commit | a49555a9e1547a513e2f22d0a2a3ef92cddbec3d (patch) | |
tree | d48913df7583698a2dc197b9565f4396e82dd74d /ext/odbc/php_odbc.c | |
parent | e74f89d95a1e33181f70f35cd8ccffe5dc0bb98b (diff) | |
download | php-git-a49555a9e1547a513e2f22d0a2a3ef92cddbec3d.tar.gz |
Fix #80147: BINARY strings may not be properly zero-terminated
We have to manually ensure that all strings fetched from a data source
are zero-terminated.
Closes GH-6213.
Diffstat (limited to 'ext/odbc/php_odbc.c')
-rw-r--r-- | ext/odbc/php_odbc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index c2d1a8f846..a93252f7c4 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -2221,6 +2221,7 @@ PHP_FUNCTION(odbc_result) if (rc != SQL_SUCCESS_WITH_INFO) { field_str = zend_string_truncate(field_str, result->values[field_ind].vallen, 0); } + ZSTR_VAL(field_str)[ZSTR_LEN(field_str)] = '\0'; RETURN_NEW_STR(field_str); break; |