From 97f2fc9d7fa49d334c6b70bb8b0d779b11a74ee5 Mon Sep 17 00:00:00 2001 From: Dysphie Date: Sat, 22 Apr 2023 05:19:36 -0300 Subject: [PATCH] Increase Cookie.GetInt/SetInt buffer size (#1995) Current implementation does not account for negative sign or null term --- plugins/include/clientprefs.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/include/clientprefs.inc b/plugins/include/clientprefs.inc index 6ab4e203..e3ae56eb 100644 --- a/plugins/include/clientprefs.inc +++ b/plugins/include/clientprefs.inc @@ -139,7 +139,7 @@ methodmap Cookie < Handle { // @param value Integer value to set. // @error Invalid cookie handle or invalid client index. public void SetInt(int client, int value) { - char sValue[11]; + char sValue[12]; IntToString(value, sValue, sizeof(sValue)); this.Set(client, sValue); @@ -173,7 +173,7 @@ methodmap Cookie < Handle { // @error Invalid cookie handle or invalid client index. public int GetInt(int client, int defaultValue = 0) { - char buffer[11]; + char buffer[12]; this.Get(client, buffer, sizeof(buffer)); int value;