Versions Compared

Key

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

...

Standard Library Functions

Here Following is an incomplete list of C library functions that to which this rule applies to:

memcpy()

memmove()

memset()

 

wmemcpy()

wmemmove()

strftime()

 

calloc()

malloc()

realloc()

 

strncpy()

swprintf()

vswprintf()

 

wcsncpy()

strxfrm()

snprintf()

 

vsnprintf()

fwrite()*

fread()*

 

...

the programmer should make sure the memory block to which ptr points is of at least (size*count) bytes.

Description

To guarentee guarantee that a library function does not construct an out-of-bounds pointer, programmers must heed the following rules when using functions that operate on pointed-to regions. These rules assume that func is a function, p and q are pointers, and n is an integer.

...