aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2019-07-07 07:02:40 (GMT)
committerJouni Malinen <j@w1.fi>2019-07-07 07:07:10 (GMT)
commit4eab36595e180bd285229f5497cfc05c0fccc545 (patch)
tree34f7857ea507863c752ff483688e3e4e8cd2af77
parentd3a035169bbc6a67a98461dda1345a3f992c561f (diff)
downloadhostap-4eab36595e180bd285229f5497cfc05c0fccc545.zip
hostap-4eab36595e180bd285229f5497cfc05c0fccc545.tar.gz
hostap-4eab36595e180bd285229f5497cfc05c0fccc545.tar.bz2
Silence static analyzer warning about null termination of a string
The buf[] array is initialized to zeros, so it was already null terminated since the read() call did not allow the last character of the buffer to be overwritten. Since that was apparently not enough to make some static analyzers understand the design, use explicit null termination after a successful read() call. Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--src/utils/wpa_debug.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/utils/wpa_debug.c b/src/utils/wpa_debug.c
index c437000..c336e53 100644
--- a/src/utils/wpa_debug.c
+++ b/src/utils/wpa_debug.c
@@ -144,6 +144,7 @@ int wpa_debug_open_linux_tracing(void)
printf("failed to read /proc/mounts\n");
return -1;
}
+ buf[buflen] = '\0';
line = strtok_r(buf, "\n", &tmp1);
while (line) {