Skip to content

Commit b5001f5

Browse files
committed
MFH: fix buffer overrun
1 parent afd781a commit b5001f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/standard/ftp_fopen_wrapper.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count
611611

612612
tmp_len = MIN(sizeof(ent->d_name), basename_len - 1);
613613
memcpy(ent->d_name, basename, tmp_len);
614-
ent->d_name[tmp_len] = '\0';
614+
ent->d_name[tmp_len - 1] = '\0';
615615
efree(basename);
616616

617617
/* Trim off trailing whitespace characters */

0 commit comments

Comments
 (0)