-1

When I'm using this line of code :

NSLog([NSString stringWithFormat:@"Connection failed: %@", [error description]]);

I get the following warning :

Format string is not a String litral(Potentially insecure)"

Michaël Azevedo
  • 3,874
  • 7
  • 31
  • 45
Shital
  • 1
  • 1
  • 1
    Possible duplicate of [Issue With Code: Format string is not a string literal](http://stackoverflow.com/questions/5428325/issue-with-code-format-string-is-not-a-string-literal) – Larme Feb 17 '16 at 13:54

1 Answers1

0

You have to use an NSString constant as first parameter of NSLog in order to avoid exploits. Change your code to :

NSLog(@"Connection failed: %@", [error description]);

The exploit is more explained on this SO question.

Community
  • 1
  • 1
Michaël Azevedo
  • 3,874
  • 7
  • 31
  • 45