Skip to content

Commit d36109b

Browse files
committed
ext/phar: use size_t type instead of int
1 parent e6e39e6 commit d36109b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ PHP NEWS
3737
. Fix file descriptor/memory leak when opening central fp fails. (nielsdos)
3838
. Fix memleak+UAF when opening temp stream in buildFromDirectory() fails.
3939
(nielsdos)
40+
. Fix potential buffer length truncation due to usage of type int instead
41+
of type size_t. (Girgias)
4042

4143
- Random:
4244
. Fix Randomizer::__serialize() w.r.t. INDIRECTs. (nielsdos)

ext/phar/phar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ int phar_open_from_filename(char *fname, size_t fname_len, char *alias, size_t a
15901590
}
15911591
/* }}}*/
15921592

1593-
static inline char *phar_strnstr(const char *buf, int buf_len, const char *search, int search_len) /* {{{ */
1593+
static inline char *phar_strnstr(const char *buf, size_t buf_len, const char *search, size_t search_len) /* {{{ */
15941594
{
15951595
const char *c;
15961596
ptrdiff_t so_far = 0;

ext/phar/stream.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int
673673
{
674674
php_url *resource;
675675
char *internal_file, *error;
676-
int internal_file_len;
676+
size_t internal_file_len;
677677
phar_entry_data *idata;
678678
phar_archive_data *pphar;
679679
uint32_t host_len;

0 commit comments

Comments
 (0)