mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-09 23:55:42 +01:00
Fixed buffer overflow spotted by Henrik
This commit is contained in:
parent
762dd6b564
commit
76702105ec
1 changed files with 2 additions and 2 deletions
|
@ -178,8 +178,8 @@ static snd_mixer_sid_t __simple_id ATTRIBUTE_UNUSED;
|
|||
|
||||
static char *simple_name(const char *name, char *result)
|
||||
{
|
||||
strncpy(result, name, simple_name_size);
|
||||
result[simple_name_size] = '\0';
|
||||
strncpy(result, name, simple_name_size - 1);
|
||||
result[simple_name_size - 1] = '\0';
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue