mirror of
https://github.com/linux-msm/pd-mapper.git
synced 2026-02-25 13:12:10 -08:00
pd-mapper: Null terminate firmware_value string
Null terminate firmware_value string to prevent strlen() read past the end of buffer error on AOSP. Otherwise pd-mapper will crash: console:/ # pd-mapper FORTIFY: strlen: detected read past end of buffer Aborted 134|console:/ # Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
This commit is contained in:
committed by
Bjorn Andersson
parent
d7fe25fa6e
commit
aaed6554da
@@ -242,6 +242,8 @@ static int pd_enumerate_jsons(struct assoc *json_set)
|
||||
continue;
|
||||
}
|
||||
|
||||
firmware_value[n] = '\0';
|
||||
|
||||
if (strlen(FIRMWARE_BASE) + strlen(firmware_value) + 1 > sizeof(path))
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user