-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
strutils: fix buffer overflow in formatBiggestFloat (#1423)
## Summary Fixed a potential buffer overflow in `struts.formatBiggestFloat`. ## Details Previously, `strutils.formatBiggestFloat` was implemented using `sprintf` and as such came with a risk of buffer overflow. This was observed via tests in disruptek/insideout. * Replaced `sprintf` with `snprintf`. * Remove the 2 KiB temporary buffer in favor of directly outputting to the target buffer. * Added extra error checking code for errors from `snprintf`.
- Loading branch information
Showing
1 changed file
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters