Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make sure cm.entityString is null-terminated, see #649
  • Loading branch information
Kangz committed Mar 24, 2015
1 parent 242b9bc commit 0ace454
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/cm/cm_load.cpp
Expand Up @@ -675,9 +675,10 @@ void CMod_LoadEntityString( lump_t *l )
char keyname[ MAX_TOKEN_CHARS ];
char value[ MAX_TOKEN_CHARS ];

cm.entityString = ( char * ) CM_Alloc( l->filelen );
cm.entityString = ( char * ) CM_Alloc( l->filelen + 1);
cm.numEntityChars = l->filelen;
Com_Memcpy( cm.entityString, cmod_base + l->fileofs, l->filelen );
cm.entityString[l->filelen] = '\0';

p = cm.entityString;

Expand Down

0 comments on commit 0ace454

Please sign in to comment.