Open pszalko opened 10 years ago
NSString (NXOAuth2) category crashes when parameter value is other than NSString.
The following code requires every param value to be NSString, but it doesn't check if it's true.
+ (NSString *)nxoauth2_stringWithEncodedQueryParameters:(NSDictionary *)parameters; { NSMutableArray *parameterPairs = [NSMutableArray array]; for (NSString *key in [parameters allKeys]) { NSString *pair = [NSString stringWithFormat:@"%@=%@", [key nxoauth2_URLEncodedString], [[parameters objectForKey:key] nxoauth2_URLEncodedString]]; [parameterPairs addObject:pair]; } return [parameterPairs componentsJoinedByString:@"&"]; }
Steps to reproduce the issue is to pass anything than NSString to as parameters value.
Example dictionary:
parameters = @{@"key" : @34}
NSString (NXOAuth2) category crashes when parameter value is other than NSString.
The following code requires every param value to be NSString, but it doesn't check if it's true.
Steps to reproduce the issue is to pass anything than NSString to as parameters value.
Example dictionary: