diff options
author | BlackEagle <ike.devolder@gmail.com> | 2019-02-19 03:26:00 +0100 |
---|---|---|
committer | Peter Kokot <peterkokot@gmail.com> | 2019-02-19 03:26:00 +0100 |
commit | a8336fb7b91a085661acad844854b89230214acb (patch) | |
tree | 20cd2f630e199e25b5951c8a68ec457fcee3059c /ext/gd | |
parent | 5bbf0c698fff2002efe370af78def3a8584cfa08 (diff) | |
download | php-git-a8336fb7b91a085661acad844854b89230214acb.tar.gz |
gd imageloadfont, verify error while reading header
when reading the header verify we get an error when the header is
invalid.
Signed-off-by: BlackEagle <ike.devolder@gmail.com>
Diffstat (limited to 'ext/gd')
-rw-r--r-- | ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt b/ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt index 56ff799eb0..ef13bb179d 100644 --- a/ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt +++ b/ext/gd/tests/imageloadfont_end_of_file_while_reading_header.phpt @@ -10,11 +10,19 @@ if (!extension_loaded('gd')) die("skip gd extension not available\n"); --FILE-- <?php $filename = dirname(__FILE__) . '/font.gdf'; + +// End of file while reading header $bin = "\x41\x41\x41\x41\x00\x00\x00\x00\x00\x00"; $fp = fopen($filename, 'wb'); fwrite($fp, $bin); fclose($fp); +$font = imageloadfont($filename); +// Error while reading header +$bin = "\xe0\x00\x00\x00\x20\x00\x00\x00\x06\x00\x00\x00\x0a\x00\x00"; +$fp = fopen($filename, 'wb'); +fwrite($fp, $bin); +fclose($fp); $font = imageloadfont($filename); ?> --CLEAN-- @@ -23,3 +31,5 @@ unlink(__DIR__.'/font.gdf'); ?> --EXPECTF-- Warning: imageloadfont(): End of file while reading header in %s on line %d + +Warning: imageloadfont(): End of file while reading header in %s on line %d |