From 09aeda21629b597975031f0c3102e1497607b447 Mon Sep 17 00:00:00 2001 From: toddouska Date: Mon, 1 Dec 2014 14:34:48 -0800 Subject: [PATCH] fix SetCipherList() possible 1 byte overrun --- src/internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index d395b977f..69ca5dbb4 100644 --- a/src/internal.c +++ b/src/internal.c @@ -9019,7 +9019,7 @@ int SetCipherList(Suites* suites, const char* list) : (word32)(next - current)); XSTRNCPY(name, current, length); - name[length] = 0; + name[(length == sizeof(name)) ? length - 1 : length] = 0; for (i = 0; i < suiteSz; i++) { if (XSTRNCMP(name, cipher_names[i], sizeof(name)) == 0) {