Skip to content

NAVASSA: off by one error? #2774

@leizaf

Description

@leizaf

if (lineCount > sizeof(RxGainTable) / sizeof(struct RxGainTableEntry))

if (lineCount > sizeof(ORxGainTable) / sizeof(struct ORxGainTableEntry))

if (lineCount > sizeof(RxGainTable_GainCompensated) / sizeof(

shouldnt it be lineCount >= sizeof(...)?, otherwise you index with the list length which is obviously wrong.

Also here:


gainIndex >= ..., other wise you end up calling adi_hal_RxGainTableEntryGet in the next iteration with an out of bound lineCount, (which you do not properly catch in your example). I noticed this because my implementation of adi_hal_RxGainTableEntryGet is being passed out of bounds lineCount.

cc @buha

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions