Skip to content

Commit 8009c16

Browse files
authored
client: message: fix off by one error when allocating buffer for custom hud text message
This is utterly embarrassing.
1 parent e243085 commit 8009c16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cl_dll/message.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ client_textmessage_t *CHudMessage::AllocMessage( const char *text, client_textme
715715
if( text )
716716
{
717717
int len = strlen( text );
718-
char *szCustomText = new char[len];
718+
char *szCustomText = new char[len + 1];
719719
strcpy( szCustomText, text );
720720

721721
ret->pName = "Custom";

0 commit comments

Comments
 (0)