summaryrefslogtreecommitdiff
path: root/src/qcommon
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2009-10-03 12:25:02 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:56 +0000
commit788fdf35246001ba4178dcac7665954479871f48 (patch)
treed6d61954d6a9c9380db3684a3b22a6780097e697 /src/qcommon
parent198186fb98445ef4f27e89bd7489824500ab6eec (diff)
* (bug 3416) Overlapping strings with strcpy (thanks Jacques Boscq)
* (bug 3576) Allow % since people promise it is safe (/dev/humancontroller)
Diffstat (limited to 'src/qcommon')
-rw-r--r--src/qcommon/msg.c12
-rw-r--r--src/qcommon/parse.c2
2 files changed, 1 insertions, 13 deletions
diff --git a/src/qcommon/msg.c b/src/qcommon/msg.c
index 837c3696..8be19aca 100644
--- a/src/qcommon/msg.c
+++ b/src/qcommon/msg.c
@@ -448,10 +448,6 @@ char *MSG_ReadString( msg_t *msg ) {
if ( c == -1 || c == 0 ) {
break;
}
- // translate all fmt spec to avoid crash bugs
- if ( c == '%' ) {
- c = '.';
- }
// don't allow higher ascii values
if ( c > 127 ) {
c = '.';
@@ -476,10 +472,6 @@ char *MSG_ReadBigString( msg_t *msg ) {
if ( c == -1 || c == 0 ) {
break;
}
- // translate all fmt spec to avoid crash bugs
- if ( c == '%' ) {
- c = '.';
- }
// don't allow higher ascii values
if ( c > 127 ) {
c = '.';
@@ -504,10 +496,6 @@ char *MSG_ReadStringLine( msg_t *msg ) {
if (c == -1 || c == 0 || c == '\n') {
break;
}
- // translate all fmt spec to avoid crash bugs
- if ( c == '%' ) {
- c = '.';
- }
// don't allow higher ascii values
if ( c > 127 ) {
c = '.';
diff --git a/src/qcommon/parse.c b/src/qcommon/parse.c
index 9308aa6e..2156f75b 100644
--- a/src/qcommon/parse.c
+++ b/src/qcommon/parse.c
@@ -979,7 +979,7 @@ static void Parse_StripDoubleQuotes(char *string)
{
if (*string == '\"')
{
- strcpy(string, string+1);
+ memmove( string, string + 1, strlen( string ) + 1 );
}
if (string[strlen(string)-1] == '\"')
{