Versions Compared

Key

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

...

Code Block
size_t num_elements = get_size();
unsigned long long *buffer = calloc(num_elements, sizeof(unsigned long long));

...

Compliant Solution 1

Code Block
size_t num_elements = calc_size();
size_t size = sizeof(unsigned long long);
if () {
   unsigned long long *buffer = calloc(num_elements, sizeof(unsigned long long));
}
else {
/* Handle error condition */
}

...

RUS-CERT Advisory 2002-08:02, http://cert.uni-stuttgart.de/advisories/calloc.phpImage Removed
Secunia Advisory SA10635, http://secunia.com/advisories/10635/Image Removed