Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3630] iOS: Creating MD5 hash from Blob crashes app.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-11-03T09:22:21.000+0000
Affected Version/sn/a
Fix Version/sSprint 2011-44, Release 1.8.0
ComponentsiOS
Labelsmodule_utils, qe-testadded
ReporterPedro Enrique
AssigneeReggie Seagraves
Created2011-04-20T09:54:27.000+0000
Updated2011-11-21T17:10:02.000+0000

Description

Titanium.Utils.md5HexDigest works fine when using a string, but using a blob, like an image file, crashes the app on iOS. Test case here: http://pastie.org/private/lncwwujkwuzbet40dfhyga Helpdesk ticket: http://appc.me/c/RGY-41553-642 Tested on 1.6.3 (Apr 18 2011 14:44 r878906de) iPhone Simulator 4.3

Attachments

FileDateSize
play-2011-11-02-15-11.crash.txt2011-11-02T14:18:35.000+000034112

Comments

  1. Dawson Toth 2011-11-02

    Just verified that this still crashes with 1.8.0 as well.
       var win = Ti.UI.createWindow({ backgroundColor: 'green' });
       win.open();
       Ti.Utils.md5HexDigest(win.toImage());
       
    Attached is a crash log. When I ran from Xcode, I received an EXC_BAD_ACCESS somewhere in the following lines of UtilsModule.m. I'm guessing this is expected behavior at the moment, given that we are trying to coerce an image blog to a string.
       NSString *nstr = [self convertToString:args];
       const char* data = [nstr UTF8String];
       return [TiUtils md5:[NSData dataWithBytes:data length:strlen(data)]];
       
  2. Reggie Seagraves 2011-11-03

    Pull request pending.
  3. Dustin Hyde 2011-11-21

    Bug fixed, verified on: Studio: 1.0.7.201111211330 SDK: 1.8.0.1.v20111121113056 OS: OS X Lion Devices: all iOS devices

JSON Source