Subject: | Core dump in newFromPng |
GD::Image::newFromPng (may) dump core if the the supplied file is not a
PNG file. Example (reproducible on FreeBSD 4.9 and RedHat Linux 8.0, both with perl5.8.0):
#!/usr/bin/perl -w
use GD;
$image = GD::Image->newFromPng("/etc/passwd");
__END__
A gdb backtrace shows:
(gdb) bt
#0 0x402573ae in gd_chkimagefmt (image=0x0, truecolor=0) at GD.xs:499
#1 0x40257cfc in XS_GD__Image__newFromPng (cv=0x8251bb8) at GD.xs:566
#2 0x080cd4f0 in Perl_pp_entersub () at pp_hot.c:2854
#3 0x080afc71 in Perl_runops_debug () at dump.c:1442
#4 0x080624ca in S_run_body (oldscope=1) at perl.c:1921
#5 0x08062059 in perl_run (my_perl=0x816df68) at perl.c:1840
#6 0x0805e501 in main (argc=2, argv=0xbfffdc54, env=0xbfffdc60)
at perlmain.c:86
#7 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6
Regards,
Slaven