From 39677c1b0fb1180b28c12035670e0574fdf31fa5 Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Mon, 4 Jun 2012 09:12:59 +0200 Subject: [PATCH] Fix a potential buffer overflow --- src/common/command/cmd_parser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/command/cmd_parser.c b/src/common/command/cmd_parser.c index b05fc88f..7a5e15b5 100644 --- a/src/common/command/cmd_parser.c +++ b/src/common/command/cmd_parser.c @@ -146,7 +146,10 @@ void Cbuf_Execute (void) { if (text[i] == '\n') break; } - + + if( i > sizeof( line ) - 1 ) { + i = sizeof( line ) - 1; + } memcpy (line, text, i); line[i] = 0;