Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ PHP NEWS
. DirectoryIterator key can now work better with filesystem supporting larger
directory indexing. (David Carlier)

- Sqlite3:
. Fix NUL byte truncation in sqlite3 TEXT column handling. (ndossche)

- Standard:
. Fixed bug GH-19926 (reset internal pointer earlier while splicing array
while COW violation flag is still set). (alexandre-daubois)
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_ini_scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED && \
(YYSTATE == STATE(ST_VALUE) || YYSTATE == STATE(ST_RAW))) {\
zend_ini_copy_typed_value(ini_lval, type, str, len); \
Z_EXTRA_P(ini_lval) = 0; \
} else { \
zend_ini_copy_value(ini_lval, str, len); \
} \
Z_EXTRA_P(ini_lval) = 0; \
return type; \
}

Expand Down
2 changes: 1 addition & 1 deletion ext/sqlite3/sqlite3.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ static void sqlite_value_to_zval(sqlite3_stmt *stmt, int column, zval *data) /*
break;

case SQLITE3_TEXT:
ZVAL_STRING(data, (char*)sqlite3_column_text(stmt, column));
ZVAL_STRINGL(data, (const char *) sqlite3_column_text(stmt, column), sqlite3_column_bytes(stmt, column));
break;

case SQLITE_BLOB:
Expand Down
38 changes: 38 additions & 0 deletions ext/sqlite3/tests/text_column_NUL_bytes.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
--TEST--
Text column with NUL bytes
--EXTENSIONS--
sqlite3
--FILE--
<?php
$db = new SQLite3(':memory:');

$db->exec(
'CREATE TABLE messages (
content TEXT
)'
);

$insert = $db->prepare(
'INSERT INTO messages (content) VALUES (:content)'
);

$insert->bindValue(':content', "with\0null", SQLITE3_TEXT);
$insert->execute();
$insert->bindValue(':content', "\0", SQLITE3_TEXT);
$insert->execute();

$result = $db->query('SELECT * FROM messages');
while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
var_dump($row);
}

?>
--EXPECTF--
array(1) {
["content"]=>
string(9) "with%0null"
}
array(1) {
["content"]=>
string(1) "%0"
}
14 changes: 14 additions & 0 deletions ext/standard/tests/gh20695.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
GH-20695 (Assertion failure in normalize_value() when parsing malformed INI input via parse_ini_string())
--FILE--
<?php
var_dump(parse_ini_string('8 [[] = !!$]', true, INI_SCANNER_TYPED));
?>
--EXPECT--
array(1) {
[8]=>
array(1) {
["["]=>
int(0)
}
}
2 changes: 1 addition & 1 deletion ext/uri/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if test "$PHP_EXTERNAL_URIPARSER" = "no"; then
$URIPARSER_DIR/src/UriSetScheme.c $URIPARSER_DIR/src/UriSetUserInfo.c $URIPARSER_DIR/src/UriShorten.c $URIPARSER_DIR/src/UriVersion.c"
URI_CFLAGS="-DURI_STATIC_BUILD"
else
PKG_CHECK_MODULES([LIBURIPARSER], [liburiparser >= 0.9.10])
PKG_CHECK_MODULES([LIBURIPARSER], [liburiparser >= 1.0.0])
PHP_EVAL_LIBLINE([$LIBURIPARSER_LIBS], [URI_SHARED_LIBADD])
PHP_EVAL_INCLINE([$LIBURIPARSER_CFLAGS])
fi
Expand Down
2 changes: 1 addition & 1 deletion ext/uri/uriparser/include/uriparser/Uri.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* 207ee4485d5a4690064bec14d369884451a49ae32e907b5bc6502c2bfa338ca1 (0.9.9+)
/* 5abed1007be99942f49ffe603a894d277066b79b9cb824547af0f3b9481cb9ca (1.0.0+)
*
* uriparser - RFC 3986 URI parsing library
*
Expand Down
8 changes: 4 additions & 4 deletions ext/uri/uriparser/include/uriparser/UriBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
# define URI_ANSI_TO_UNICODE(x) URI_ANSI_TO_UNICODE_HELPER(x)

/* Version */
# define URI_VER_MAJOR 0
# define URI_VER_MINOR 9
# define URI_VER_RELEASE 9
# define URI_VER_MAJOR 1
# define URI_VER_MINOR 0
# define URI_VER_RELEASE 0
# define URI_VER_SUFFIX_ANSI ""
# define URI_VER_SUFFIX_UNICODE URI_ANSI_TO_UNICODE(URI_VER_SUFFIX_ANSI)

Expand Down Expand Up @@ -394,7 +394,7 @@ URI_PUBLIC int uriTestMemoryManager(UriMemoryManager * memory);
* @see uriEmulateReallocarray
* @see UriMemoryManager
* @see uriTestMemoryManager
* @since 0.9.10
* @since 1.0.0
*/
URI_PUBLIC int uriTestMemoryManagerEx(UriMemoryManager * memory,
UriBool challengeAlignment);
Expand Down