Commit 7c981b5
config_format: fix possible heap overflow (#7768)
The return value of `strchr` is not checked for failure. If it's failure
then `tmp` will be `0` in the `(tmp-p)` calculation, causing `xlen` to
be `p`. `xlen` is later used for copying memory by way of `memcpy` in
string creation using `flb_sds_create_len`. This fixes it.
Signed-off-by: David Korczynski <[email protected]>1 parent 6a9f9cc commit 7c981b5
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
423 | 426 | | |
424 | 427 | | |
425 | 428 | | |
| |||
0 commit comments