db845c: qcom: tqftpserv: 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>
diff --git a/qcom/tqftpserv/translate.c b/qcom/tqftpserv/translate.c
index 15df6d8..63161a0 100644
--- a/qcom/tqftpserv/translate.c
+++ b/qcom/tqftpserv/translate.c
@@ -109,6 +109,7 @@
if (n < 0) {
continue;
}
+ firmware_value[n] = '\0';
if (strlen(FIRMWARE_BASE) + strlen(firmware_value) + 1 +
strlen(file) + 1 > sizeof(path))