From 76702105ecaa9590335ecf24fbe6abdb9653ef76 Mon Sep 17 00:00:00 2001 From: Abramo Bagnara Date: Mon, 28 Aug 2000 06:33:08 +0000 Subject: [PATCH] Fixed buffer overflow spotted by Henrik --- amixer/amixer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amixer/amixer.c b/amixer/amixer.c index 646f0a9..e938cde 100644 --- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -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; }