Skip to content

Commit ef8fc4b

Browse files
committed
Fix bug #69253 - ZIP Integer Overflow leads to writing past heap boundary
1 parent fb04dcf commit ef8fc4b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ PHP NEWS
1515
. Fixed bug #69085 (SoapClient's __call() type confusion through
1616
unserialize()). (Dmitry)
1717

18+
- ZIP:
19+
. Fixed bug #69253 (ZIP Integer Overflow leads to writing past heap
20+
boundary). (Stas)
21+
1822
19 Feb 2015 PHP 5.4.38
1923

2024
- Core:

ext/zip/lib/zip_dirent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ _zip_cdir_new(int nentry, struct zip_error *error)
101101
return NULL;
102102
}
103103

104-
if ((cd->entry=(struct zip_dirent *)malloc(sizeof(*(cd->entry))*nentry))
104+
if ( nentry > ((size_t)-1)/sizeof(*(cd->entry)) || (cd->entry=(struct zip_dirent *)malloc(sizeof(*(cd->entry))*(size_t)nentry))
105105
== NULL) {
106106
_zip_error_set(error, ZIP_ER_MEMORY, 0);
107107
free(cd);

0 commit comments

Comments
 (0)