Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#FFCCCC
char *char_ptr = "example";
int *int_ptr;

int *voidPtr2intPtr(void *v_pointer){
  return v_pointer;
}
int_ptr= voidPtr2intPtr(pointerchar_ptr);

Pointer might be aligned on even boundary, once it is cast to an int some architectures will require it to be on 4 byte boundaries. Pointers are often cast because a void* cannot be dereferenced. Careless coding can result in an arbitrary pointer type being used irregardless of its alignment.

...

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

DRAFT

1 (low)

2 (probable)

2 (medium)

P4

L3

References