From 3d3fbd78e8369ebf1e4e0775fa25b9326da2270c Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 17 Oct 2003 07:34:19 +0000 Subject: [PATCH] Fixed possible buffer overrun --- amixer/amixer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/amixer/amixer.c b/amixer/amixer.c index 76cca8d..741d59a 100644 --- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -1486,7 +1486,8 @@ int main(int argc, char *argv[]) break; case 'D': case HELPID_DEVICE: - strcpy(card, optarg); + strncpy(card, optarg, sizeof(card-1)); + card[sizeof(card)-1] = '\0'; break; case 'q': case HELPID_QUIET: