ruby on rails 3 - Carrierwave Rmagick Segmentation Fault on Wrong Photo Extension -


i got segmentation fault when attempted upload image site on heroku using carrierwave rmagick.

this part of error log output:

ruby: jpc_dec.c:1072: jpc_dec_tiledecode: assertion `dec->numcomps == 3' failed. /app/.bundle/gems/ruby/1.9.1/gems/carrierwave-0.5.4/lib/carrierwave/processing/rmagick.rb:248: [bug] segmentation fault ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux] 

after investigation, segmentation fault occurs because attempted upload jpeg2000 file .jpg extension instead of correct .jp2 extension.

is bug rmagick?

more importantly, possible prevent users of site triggering segmentation fault sending image wrong extension?

thanks!

i doubt error. use tool, 'file' verify file format.

also should think way makes possible recover if ruby crashes. run process in background. should make sure have checks in place can respond when tries repeatedly crash software. otherwise you're easy denial of service target.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -