File tree 3 files changed +14
-1
lines changed 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ PHP NEWS
11
11
- Curl:
12
12
. Fixed bug GH-16723 (CURLMOPT_PUSHFUNCTION issues). (cmb)
13
13
14
+ - GD:
15
+ . Fixed GH-16776 (imagecreatefromstring overflow). (David Carlier)
16
+
14
17
- Hash:
15
18
. Fixed GH-16711: Segfault in mhash(). (Girgias)
16
19
Original file line number Diff line number Diff line change @@ -1366,7 +1366,7 @@ static int _php_ctx_getmbi(gdIOCtx *ctx)
1366
1366
1367
1367
do {
1368
1368
i = (ctx -> getC )(ctx );
1369
- if (i < 0 ) {
1369
+ if (i < 0 || mbi > ( INT_MAX >> 7 ) ) {
1370
1370
return -1 ;
1371
1371
}
1372
1372
mbi = (mbi << 7 ) | (i & 0x7f );
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-16771 (UBSan abort in ext/gd/libgd/gd.c:1372)
3
+ --EXTENSIONS--
4
+ gd
5
+ --FILE--
6
+ <?php
7
+ $ string_mb = base64_decode ('5pel5pys6Kqe44OG44Kt44K544OIMzTvvJXvvJbml6XmnKzoqp7jg4bjgq3jgrnjg4g= ' );
8
+ imagecreatefromstring ($ string_mb );
9
+ --EXPECTF --
10
+ Warning: imagecreatefromstring(): Data is not in a recognized format in %s on line %d
You can’t perform that action at this time.
0 commit comments