Versions Compared

Key

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

...

Code Block
bgColor#FFcccc
size_t size;

/* initialize size, possibly by user-controlled input */

int *list = (int *)malloc(size);
if (list == NULL) {
  /* Handle Allocation Error */
}
/* Continue Processing list */

...

Code Block
bgColor#ccccff
size_t size;

/* initialize size, possibly by user-controlled input */

if (size == 0) {
  /* Handle Error */
}
int *list = (int *)malloc(size);
if (list == NULL) {
  /* Handle Allocation Error */
}
/* Continue Processing list */

...