tags:
- c
- programming
- security
- forum
- notes
source: https://cboard.cprogramming.com/c-programming/104011-sprintf-unsafe-use.html
created: 2024-12-14
published: 2008-06-11
Under what conditions can sprintf
be unsafe?
sprintf
can be unsafe when the buffer isn't large enough to hold the formatted data.
What can you do to make standard functions like sprintf
safer?
You can make standard functions like sprintf
safer by writing safer non-portable functions which are wrapped around the standard function.
For what kinds of input is sprintf
unsafe to use?
sprintf
is unsafe to use on inputs where you don't know if the size of it is safe.