Skip to content

int _baseCellToCCWrot60: Possible Buffer Overflow #978

Description

@stasos24

Since array :

static const BaseCellRotation faceIjkBaseCells[NUM_ICOSA_FACES][3][3][3] = {

has size:
#define NUM_ICOSA_FACES 20

it could be overflow at:
int _baseCellToCCWrot60(int baseCell, int face) {
if (face < 0 || face > NUM_ICOSA_FACES) return INVALID_ROTATIONS;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
for (int k = 0; k < 3; k++) {
if (faceIjkBaseCells[face][i][j][k].baseCell == baseCell) {
return faceIjkBaseCells[face][i][j][k].ccwRot60;

when face = 20

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions