Commit 34776865 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* check whether p_item->input.psz_name exists, because stringWith*String...

* check whether p_item->input.psz_name exists, because stringWith*String crashes on non-existant strings
parent ad9f1332
...@@ -303,6 +303,9 @@ ...@@ -303,6 +303,9 @@
//NSLog( @"values for %p", p_item ); //NSLog( @"values for %p", p_item );
if( [[o_tc identifier] isEqualToString:@"1"] ) if( [[o_tc identifier] isEqualToString:@"1"] )
{
/* sanity check to prevent the NSString class from crashing */
if( p_item->input.psz_name != NULL )
{ {
o_value = [NSString stringWithUTF8String: o_value = [NSString stringWithUTF8String:
p_item->input.psz_name]; p_item->input.psz_name];
...@@ -310,6 +313,7 @@ ...@@ -310,6 +313,7 @@
o_value = [NSString stringWithCString: o_value = [NSString stringWithCString:
p_item->input.psz_name]; p_item->input.psz_name];
} }
}
else if( [[o_tc identifier] isEqualToString:@"2"] ) else if( [[o_tc identifier] isEqualToString:@"2"] )
{ {
char *psz_temp; char *psz_temp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment