php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57460 Upon loading empty/null blob , Sig11 ocurrs
Submitted: 2006-12-28 06:28 UTC Modified: 2007-04-05 07:53 UTC
From: konrads dot smelkovs at gmail dot com Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 5.1.2 OS: UbuntuLinux 6.06.12.6.15-27-686
Private report: No CVE-ID: None
 [2006-12-28 06:28 UTC] konrads dot smelkovs at gmail dot com
Description:
------------
Actual imagick error:
Zero-length blob not permitted 

It happens when loading zero length blob. imagick.c incorrectly assumes on line 1233 , that handle->exception.description is always defined and crashes when it is not, see here:
(gdb) print handle->exception
$4 = {severity = BlobError, error_number = 0, reason = 0x8686780 "Zero-length blob not permitted `'",
  description = 0x0, signature = 2880220587}
This causes it to access handle->image that is NULL and sig11.
Furthermore, in cleanup code, imagick.c:666,
 efree( IMAGICK_G( last_error_description ) ) ;
Segfaults, since last_error_description is NULL.
Patch attached. Have a nice day.

Reproduce code:
---------------
patch to imagick.c
665d664
<
667,669c666
<               if(IMAGICK_G(last_error_description )){
<                       efree( IMAGICK_G( last_error_description ) ) ;
<               }
---
>               efree( IMAGICK_G( last_error_description ) ) ;
1235c1232,1233
<       if ( handle->image && handle->image->exception.description )
---
>
>       if ( handle->image->exception.description )



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-05 07:53 UTC] scott at macvicar dot net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 17:01:30 2024 UTC