Return an unsigned integer when casting to UIBackgroundTaskIdentifier

In MSIDBackgroundTaskManager.m line 111, a signed integer value is returned.

- (UIBackgroundTaskIdentifier)backgroundTaskWithType:(MSIDBackgroundTaskType)type { return [[self.taskCache objectForKey:@(type)] integerValue]; }

However, UIBackgroundTaskIdentifier is defined as an unsigned integer.

typedef NSUInteger UIBackgroundTaskIdentifier NS_TYPED_ENUM;

Implicit casts between signed and unsigned numbers can result in integer overflow and buffer overflow security vulnerabilities.

Read more here: Source link