farhan678 / adwhirl

Automatically exported from code.google.com/p/adwhirl
0 stars 0 forks source link

Potential null dereference on iOS #179

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following line: AdWhirl/AdWhirl/internal/AdWhirlConfig.m:514 could cause a 
crash.

The current code looks like:

- (BOOL)parseConfig:(NSData *)data error:(NSError **)error {
  if (hasConfig) {
    *error = [AdWhirlError errorWithCode:AdWhirlConfigDataError
                             description:@"Already has config, will not parse"];
    return NO;
  }
...
...

*** should be ***

- (BOOL)parseConfig:(NSData *)data error:(NSError **)error {
  if (hasConfig) {
      if (error) {
    *error = [AdWhirlError errorWithCode:AdWhirlConfigDataError
                             description:@"Already has config, will not parse"];
      }
    return NO;
  }

According to coding standards in 'Creating and Returning NSError Objects' the 
parameter 'error' may be null, so we should check against this possibility.

I have attached the file with the fix for your consideration.

Best regards,

-- Tito

Original issue reported on code.google.com by tciuro@gmail.com on 17 Feb 2011 at 11:10

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you.

Original comment by tuyenngu...@gmail.com on 4 Aug 2011 at 4:43

GoogleCodeExporter commented 9 years ago

Original comment by wesgood...@google.com on 15 Nov 2011 at 4:18

GoogleCodeExporter commented 9 years ago

Original comment by wesgood...@google.com on 15 Nov 2011 at 8:00