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
20 changes: 7 additions & 13 deletions Zend/zend_ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1578,9 +1578,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio

static ZEND_COLD void zend_ast_export_str(smart_str *str, const zend_string *s)
{
size_t i;

for (i = 0; i < ZSTR_LEN(s); i++) {
for (size_t i = 0; i < ZSTR_LEN(s); i++) {
unsigned char c = ZSTR_VAL(s)[i];
if (c == '\'' || c == '\\') {
smart_str_appendc(str, '\\');
Expand All @@ -1593,9 +1591,7 @@ static ZEND_COLD void zend_ast_export_str(smart_str *str, const zend_string *s)

static ZEND_COLD void zend_ast_export_qstr(smart_str *str, char quote, const zend_string *s)
{
size_t i;

for (i = 0; i < ZSTR_LEN(s); i++) {
for (size_t i = 0; i < ZSTR_LEN(s); i++) {
unsigned char c = ZSTR_VAL(s)[i];
if (c < ' ') {
switch (c) {
Expand Down Expand Up @@ -1636,12 +1632,11 @@ static ZEND_COLD void zend_ast_export_qstr(smart_str *str, char quote, const zen
}
}

static ZEND_COLD void zend_ast_export_quoted_str(smart_str *str, zend_string *s)
static ZEND_COLD void zend_ast_export_quoted_str(smart_str *str, const zend_string *s)
{
size_t i;

for (i = 0; i < ZSTR_LEN(s); i++) {
if ((unsigned char) ZSTR_VAL(s)[i] < ' ') {
for (size_t i = 0; i < ZSTR_LEN(s); i++) {
unsigned char c = ZSTR_VAL(s)[i];
if (c < ' ') {
smart_str_appendc(str, '"');
zend_ast_export_qstr(str, '"', s);
smart_str_appendc(str, '"');
Expand Down Expand Up @@ -1940,11 +1935,10 @@ static ZEND_COLD void zend_ast_export_zval(smart_str *str, const zval *zv, int p
}
if (key) {
zend_ast_export_quoted_str(str, key);
smart_str_appends(str, " => ");
} else {
smart_str_append_long(str, idx);
smart_str_appends(str, " => ");
}
smart_str_appends(str, " => ");
zend_ast_export_zval(str, val, 0, indent);
} ZEND_HASH_FOREACH_END();
smart_str_appendc(str, ']');
Expand Down
2 changes: 1 addition & 1 deletion ext/ftp/ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ static bool ftp_readline(ftpbuf_t *ftp)
}

data = eol;
if ((rcvd = my_recv(ftp, ftp->fd, data, size)) < 1) {
if (size < 2 || (rcvd = my_recv(ftp, ftp->fd, data, size - 1)) < 1) {
*data = 0;
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion ext/ftp/tests/bug80901.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ ftp_systype($ftp);
--EXPECTF--
bool(true)

Warning: ftp_systype(): **************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** in %s on line %d
Warning: ftp_systype(): *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** in %s on line %d