File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 7
7
- Fixed a potential stack overflow bug with BMP images (Issue #466 )
8
8
- Fixed a potential heap overflow bug with the table-of-contents (Issue #467 )
9
9
- Fixed a potential heap overflow bug with headings (Issue #468 )
10
+ - Fixed a potential stack overflow bug with GIF images (Issue #470 )
10
11
11
12
12
13
# Changes in HTMLDOC v1.9.14
Original file line number Diff line number Diff line change @@ -465,7 +465,6 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
465
465
{
466
466
uchar buf[260 ];
467
467
468
-
469
468
if (!gif_eof)
470
469
while (gif_get_block (fp, buf) > 0 );
471
470
@@ -482,17 +481,23 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
482
481
483
482
while (code >= clear_code)
484
483
{
484
+ if (sp >= (stack + sizeof (stack)))
485
+ return (255 );
486
+
485
487
*sp++ = table[1 ][code];
488
+
486
489
if (code == table[0 ][code])
487
490
return (255 );
488
491
489
492
code = table[0 ][code];
490
493
}
491
494
495
+ if (sp >= (stack + sizeof (stack)))
496
+ return (255 );
497
+
492
498
*sp++ = firstcode = table[1 ][code];
493
- code = max_code;
494
499
495
- if (code < 4096 )
500
+ if (( code = max_code) < 4096 )
496
501
{
497
502
table[0 ][code] = oldcode;
498
503
table[1 ][code] = firstcode;
You can’t perform that action at this time.
0 commit comments