mirror of
https://github.com/linux-msm/tqftpserv.git
synced 2026-02-25 13:12:17 -08:00
translate: Null terminate firmware_value string
Null terminate firmware_value string to prevent strlen() read past the end of buffer. Change-Id: I57cd01c4d0c58c6057872bc4b36129f09bc034a3 Signed-off-by: Amit Pundir <amit.pundir@linaro.org> Signed-off-by: John Stultz <john.stultz@linaro.org>
This commit is contained in:
committed by
Bjorn Andersson
parent
538efb3096
commit
de42697a24
@@ -109,6 +109,7 @@ static int translate_readonly(const char *file)
|
||||
if (n < 0) {
|
||||
continue;
|
||||
}
|
||||
firmware_value[n] = '\0';
|
||||
|
||||
if (strlen(FIRMWARE_BASE) + strlen(firmware_value) + 1 +
|
||||
strlen(file) + 1 > sizeof(path))
|
||||
|
||||
Reference in New Issue
Block a user