hughbe / OfficeFileReader

Swift .doc and .ppt file reader
11 stars 2 forks source link

Integer literal '4294967295' overflows when stored into 'Int32' #2

Open amanbind007 opened 1 month ago

amanbind007 commented 1 month ago

I Recently updated my Xcode to version 16. Now I'm getting this error in my project.

In Sources/OfficeFileReader/MS-DOC/TBDelta.swift on line 74

        let cidNext: Int32 = try dataStream.read(endianess: .littleEndian)
        if self.dopr == .insert && fAtEnd && cidNext != 0xFFFFFFFF {            <------- Here
            throw OfficeFileError.corrupted
        } else if self.dopr == .insert && !fAtEnd && cidNext != 0x00001EF9 {
            throw OfficeFileError.corrupted
        }

Getting this error: Integer literal '4294967295' overflows when stored into 'Int32'

hughbe commented 1 month ago

Maybe we should use UInt32 instead of Int32?

amanbind007 commented 1 month ago

Yeah, that would fix it.

amanbind007 commented 1 month ago

3 opened a pull request for fix