Commit 00a52eb
committed
[Valgrind] Fix buffer overrun in MCU_sttrtor8()
The char buffer passed to `MCU_strtor8()` is not guaranteed to be
nul-terminated, which means that `strnlen` rather than `strlen` must
be used if you want measure the length of the string in the buffer.
Fixing this exposed a bug whereby the length `l` and string pointer
`sptr` locals were not being reset after failing to parse an integer
from the buffer.1 parent 38b5704 commit 00a52eb
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
| 168 | + | |
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| |||
0 commit comments