Skip to content

Buffer overflow #2

Description

@kevinjwalters

The count variable is incremented here before the assignment to the array. This means the index values used will be 1 to 512 rather than 0 to 511. The last value of 512 will write beyond the end of the 512 byte array potentially trampling on other things.

if (count < LENGTH) {
count++;
rawData[count] = analogRead(A0)>>2;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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