Skip to content

Commit 97f2fc9

Browse files
authored
Increase Cookie.GetInt/SetInt buffer size (alliedmodders#1995)
Current implementation does not account for negative sign or null term
1 parent 2e1235a commit 97f2fc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/include/clientprefs.inc

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ methodmap Cookie < Handle {
139139
// @param value Integer value to set.
140140
// @error Invalid cookie handle or invalid client index.
141141
public void SetInt(int client, int value) {
142-
char sValue[11];
142+
char sValue[12];
143143
IntToString(value, sValue, sizeof(sValue));
144144

145145
this.Set(client, sValue);
@@ -173,7 +173,7 @@ methodmap Cookie < Handle {
173173
// @error Invalid cookie handle or invalid client index.
174174
public int GetInt(int client, int defaultValue = 0)
175175
{
176-
char buffer[11];
176+
char buffer[12];
177177
this.Get(client, buffer, sizeof(buffer));
178178

179179
int value;

0 commit comments

Comments
 (0)