Skip to content

Commit b1a9d92

Browse files
committed
Changes type to avoid undefined behaviour of shifting left negative value
1 parent 9d31226 commit b1a9d92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CoreFoundation/NumberDate.subproj/CFTimeZone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ static CFIndex __CFBSearchTZPeriods(CFTimeZoneRef tz, CFAbsoluteTime at) {
485485

486486

487487
CF_INLINE int32_t __CFDetzcode(const unsigned char *bufp) {
488-
int32_t result = (bufp[0] & 0x80) ? ~0L : 0L;
488+
uint32_t result = (bufp[0] & 0x80) ? ~0L : 0L;
489489
result = (result << 8) | (bufp[0] & 0xff);
490490
result = (result << 8) | (bufp[1] & 0xff);
491491
result = (result << 8) | (bufp[2] & 0xff);

0 commit comments

Comments
 (0)