Versions Compared

Key

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

...

Code Block
bgColor#FFcccc
void f2() {


	const size_t ARR_SIZE = 4;
	float a[4ARR_SIZE];
	const size_t n= sizeof(int) * ARR_SIZE;
	void *p = a;


	memset(p, 0, n);
	/* More program code */

}

...

Code Block
bgColor#ccccff
void f2() {


	const size_t ARR_SIZE = 4;
	float a[4ARR_SIZE];
	const size_t n= sizeof(float) * ARR_SIZE;
	void *p = a;

	memset(p, 0, n);
	/* More program code */

}

...

API00-C. Functions should validate their parameters|../../../../../../../../../../display/seccode/API00-C.+Functions+should+validate+their+parameters||\

WG14 Document: N1579 - Rule 5.34 Forming Invalid pointers by library functions.

...