From 6a33759bb19ae386417066b04382028213a98663 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sun, 30 Nov 2014 12:42:14 +0800 Subject: [PATCH] 83675 test echo param could bust bounds Signed-off-by: Andy Green --- test-server/test-echo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test-server/test-echo.c b/test-server/test-echo.c index 6fb8ba66..77cebfb5 100644 --- a/test-server/test-echo.c +++ b/test-server/test-echo.c @@ -240,7 +240,8 @@ int main(int argc, char **argv) #ifndef LWS_NO_CLIENT case 'c': client = 1; - strcpy(address, optarg); + strncpy(address, optarg, sizeof(address) - 1); + address[sizeof(address) - 1] = '\0'; port = 80; break; case 'r':