From 651ca88a9991adf80bdfe44394390df5b9690fe8 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 9 Jun 2020 10:27:40 +0200 Subject: [PATCH] aplay: fix possible string overflow (coverity) Signed-off-by: Jaroslav Kysela --- aplay/aplay.c | 1 + 1 file changed, 1 insertion(+) diff --git a/aplay/aplay.c b/aplay/aplay.c index 08395f6..e8714d8 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -3037,6 +3037,7 @@ static int new_capture_file(char *name, char *namebuf, size_t namelen, /* get a copy of the original filename */ strncpy(buf, name, sizeof(buf)); + buf[sizeof(buf)-1] = '\0'; /* separate extension from filename */ s = buf + strlen(buf);