From: Jaroslav Kysela Date: Tue, 9 Jun 2020 08:27:40 +0000 (+0200) Subject: aplay: fix possible string overflow (coverity) X-Git-Tag: v1.2.4~26 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=651ca88a9991adf80bdfe44394390df5b9690fe8;p=alsa-utils.git aplay: fix possible string overflow (coverity) Signed-off-by: Jaroslav Kysela --- 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);