From baf88564bcf857f088839158d07ec05380ed4c7f Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 25 Feb 2024 19:23:41 +0100 Subject: [PATCH] Fix potential buffer overflow --- interface/gemmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/gemmt.c b/interface/gemmt.c index 018deb7fb5..cae00877ed 100644 --- a/interface/gemmt.c +++ b/interface/gemmt.c @@ -522,7 +522,7 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, IDEBUG_START; - buffer_size = j + k + 128 / sizeof(FLOAT); + buffer_size = 2 * (j + k) + 128 / sizeof(FLOAT); #ifdef WINDOWS_ABI buffer_size += 160 / sizeof(FLOAT); #endif @@ -611,7 +611,7 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo, #endif IDEBUG_START; - buffer_size = j + k + 128 / sizeof(FLOAT); + buffer_size = 2 * (j + k) + 128 / sizeof(FLOAT); #ifdef WINDOWS_ABI buffer_size += 160 / sizeof(FLOAT); #endif