aboutsummaryrefslogtreecommitdiffstats
path: root/doc/code/Apps.md
diff options
context:
space:
mode:
authorMingjie Shen <shen497@purdue.edu>2023-04-20 22:48:04 -0400
committerNeroBurner <pyro4hell@gmail.com>2023-12-01 08:52:42 +0100
commitc9fbcd88181a61d62cd9c53cb3672ca45700b220 (patch)
tree73ba674d1b2745a7414548fbc17cd4250d1da498 /doc/code/Apps.md
parente89e5e4d66dcfb45c1f5137cd854f49b925de513 (diff)
Fix potential buffer overflows when calling sprintf
1. Replace sprintf with snprintf, which is safer 2. An unsigned int or unsigned long int requires 11 bytes to print (including the null terminator) 3. Use PRIu16 macro to print uint16_t 4. Format string "#%2d %2d:%02d:%02d.%02d\n" in StopWatch::stopLapBtnEventHandler() requires at least 17 bytes. The 16-byte buffer would clearly be overrun if sprintf were used.
Diffstat (limited to 'doc/code/Apps.md')
0 files changed, 0 insertions, 0 deletions