Skip to content

Commit

Permalink
Fix out-of-bounds read in GenerateRandomChars (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
dysphie authored May 10, 2023
1 parent 735a2c6 commit 648813b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/Source-Chat-Relay.sp
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ void GenerateRandomChars(char[] buffer, int buffersize, int len)
char charset[] = "adefghijstuv6789!@#$%^klmwxyz01bc2345nopqr&+=";

for (int i = 0; i < len; i++)
Format(buffer, buffersize, "%s%c", buffer, charset[GetRandomInt(0, sizeof charset)]);
Format(buffer, buffersize, "%s%c", buffer, charset[GetRandomInt(0, sizeof charset - 1)]);
}

void StripCharsByBytes(char[] sBuffer, int iSize, int iMaxBytes = 3)
Expand Down

0 comments on commit 648813b

Please sign in to comment.