Commit: 5573661fc2a3e2458ef8cd29e00bea83bb67392e
Parent: 9e0bc3e63c924037fb483f3b1f08e5348399f8a2
Author: Yun-Hao Chung <howardchung@google.com>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2024-11-01 16:39:35
Tree: a9399c77c9706cdc6d91598b1828248371c95f67

textfile: Fix possible bad memory access in find_key If the searched key is a prefix of the first key in the textfile, the code will assume it's not the first line which is wrong. The issue can be reproduced by a fuzzer. More context can be found in https://issues.oss-fuzz.com/issues/42515619 To reproduce the issue, please kindly follow the instructions in https://google.github.io/oss-fuzz/advanced-topics/reproducing/ Stack trace: #0 0x55e1c450e7ce in find_key /src/bluez/src/textfile.c:133:9 #1 0x55e1c450e7ce in write_key /src/bluez/src/textfile.c:244:8 #2 0x55e1c450dc33 in LLVMFuzzerTestOneInput /src/fuzz_textfile.c:61:3 (...trace in fuzzer)

Diffstat

M src/textfile.c | 8 ++++- - - -

1 files changed, 4 insertions(+), 4 deletions(-)

View Full Diff | Patch