com php-src: Fixed Bug #67413 fileinfo: cdf_read_pro perty_info insufficient boundary chec: ext/fileinfo /libmagic/cdf.c
| From: | Remi Collet | Date: | Tue, 10 Jun 2014 12:33:37 +0000 |
| Subject: | com php-src: Fixed Bug #67413 fileinfo: cdf_read_pro perty_info insufficient boundary chec: ext/fileinfo /libmagic/cdf.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78810@lists.php.net to get a copy of this message | ||
Commit: 25b1dc917a53787dbb2532721ca22f3f36eb13c0
Author: Remi Collet <remi@php.net> Tue, 10 Jun 2014 14:33:37 +0200
Parents: da5d40bae6505364c3604385a2b6ae4e27a4a5d6
Branches: PHP-5.4 PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=25b1dc917a53787dbb2532721ca22f3f36eb13c0
Log:
Fixed Bug #67413 fileinfo: cdf_read_property_info insufficient boundary chec
Upstream:
https://github.com/file/file/commit/93e063ee374b6a75729df9e7201fb511e47e259d
Adapted for C standard.
Bugs:
https://bugs.php.net/67413
Changed paths:
M ext/fileinfo/libmagic/cdf.c
Diff:
diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c
index ee467a6..429f3b9 100644
--- a/ext/fileinfo/libmagic/cdf.c
+++ b/ext/fileinfo/libmagic/cdf.c
@@ -812,7 +812,11 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1)
goto out;
for (i = 0; i < sh.sh_properties; i++) {
- size_t ofs = CDF_GETUINT32(p, (i << 1) + 1);
+ size_t ofs, tail = (i << 1) + 1;
+ if (cdf_check_stream_offset(sst, h, p, tail * sizeof(uint32_t),
+ __LINE__) == -1)
+ goto out;
+ ofs = CDF_GETUINT32(p, tail);
q = (const uint8_t *)(const void *)
((const char *)(const void *)p + ofs
- 2 * sizeof(uint32_t));