mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-22 23:36:30 +01:00
aplay: fix possible string overflow (coverity)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
3d35bce271
commit
651ca88a99
1 changed files with 1 additions and 0 deletions
|
@ -3037,6 +3037,7 @@ static int new_capture_file(char *name, char *namebuf, size_t namelen,
|
||||||
|
|
||||||
/* get a copy of the original filename */
|
/* get a copy of the original filename */
|
||||||
strncpy(buf, name, sizeof(buf));
|
strncpy(buf, name, sizeof(buf));
|
||||||
|
buf[sizeof(buf)-1] = '\0';
|
||||||
|
|
||||||
/* separate extension from filename */
|
/* separate extension from filename */
|
||||||
s = buf + strlen(buf);
|
s = buf + strlen(buf);
|
||||||
|
|
Loading…
Reference in a new issue