Skip to content

[Coverity] Potential return value integer overflow in XPTI #18895

Open
@AlexeySachkov

Description

@AlexeySachkov

See Coverity issues at https://scan.coverity.com/projects/intel-llvm?tab=overview

CID 525275:

uint8_t registerStream(const char *StreamName) {
return (uint8_t)MStreamStringTable.add(StreamName);
}

CID 525261:

uint8_t registerVendor(const char *StreamName) {
return (uint8_t)MVendorStringTable.add(StreamName);
}

The table we are inserting into is xpti::StringTable in both cases and its add method returns xpti::string_id_t which is defined as int32_t.

Therefore, there could be an overflow resulting in an invalid ID received by callers of those register functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions