mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-23 09:10:43 +00:00
Fix integer overflow.
This commit is contained in:
parent
521778cdb4
commit
33625b9448
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=297990
@ -5,6 +5,7 @@
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= archivers
|
||||
|
||||
MASTERDIR= ${.CURDIR}/../../lang/php5
|
||||
|
18
archivers/php5-phar/files/patch-tar.c
Normal file
18
archivers/php5-phar/files/patch-tar.c
Normal file
@ -0,0 +1,18 @@
|
||||
--- tar.c.orig 2012-06-02 08:29:43.000000000 +0200
|
||||
+++ tar.c 2012-06-02 08:31:37.000000000 +0200
|
||||
@@ -337,6 +337,15 @@
|
||||
last_was_longlink = 1;
|
||||
/* support the ././@LongLink system for storing long filenames */
|
||||
entry.filename_len = entry.uncompressed_filesize;
|
||||
+ /* Check for overflow - bug 61065 */
|
||||
+ if (entry.filename_len == UINT_MAX) {
|
||||
+ if (error) {
|
||||
+ spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (invalid entry size)", fname);
|
||||
+ }
|
||||
+ php_stream_close(fp);
|
||||
+ phar_destroy_phar_data(myphar TSRMLS_CC);
|
||||
+ return FAILURE;
|
||||
+ }
|
||||
entry.filename = pemalloc(entry.filename_len+1, myphar->is_persistent);
|
||||
|
||||
read = php_stream_read(fp, entry.filename, entry.filename_len);
|
Loading…
Reference in New Issue
Block a user