Skip to content

unsigned integer overflow #13

@k373379320

Description

@k373379320

https://github.com/bestswifter/BSBacktraceLogger/blob/master/BSBacktraceLogger/BSBacktraceLogger.m#L318

untime error: unsigned integer overflow: 20274 - 21786 cannot be represented in type 'unsigned long'

for(uint32_t iSym = 0; iSym < symtabCmd->nsyms; iSym++) {
// If n_value is 0, the symbol refers to an external object.
if(symbolTable[iSym].n_value != 0) {
uintptr_t symbolBase = symbolTable[iSym].n_value;
uintptr_t currentDistance = addressWithSlide - symbolBase;
if((addressWithSlide >= symbolBase) &&
(currentDistance <= bestDistance)) {
bestMatch = symbolTable + iSym;
bestDistance = currentDistance;
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions