From a8ad49db8708b17d0b5772924b9d88a58456312a Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 10 Jul 2008 08:18:50 +0000 Subject: [PATCH] Fixed http url markup, courtesy of Cokeman. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3023 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- fteqtv/httpsv.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/fteqtv/httpsv.c b/fteqtv/httpsv.c index 90a18ffc..5edadd3b 100644 --- a/fteqtv/httpsv.c +++ b/fteqtv/httpsv.c @@ -318,31 +318,32 @@ static void HTTPSV_GenerateQTVStub(cluster_t *cluster, oproxy_t *dest, char *str { *s = 0; streamid++; - if (*streamid <= ' ') - break; - else if (*streamid >= 'a' && *streamid <= 'f') + if (*streamid >= 'a' && *streamid <= 'f') *s += 10 + *streamid-'a'; else if (*streamid >= 'A' && *streamid <= 'F') *s += 10 + *streamid-'A'; else if (*streamid >= '0' && *streamid <= '9') *s += *streamid-'0'; + else + break; *s <<= 4; streamid++; - if (*streamid <= ' ') - break; - else if (*streamid >= 'a' && *streamid <= 'f') + if (*streamid >= 'a' && *streamid <= 'f') *s += 10 + *streamid-'a'; else if (*streamid >= 'A' && *streamid <= 'F') *s += 10 + *streamid-'A'; else if (*streamid >= '0' && *streamid <= '9') *s += *streamid-'0'; + else + break; //don't let hackers try adding extra commands to it. if (*s == '$' || *s == ';' || *s == '\r' || *s == '\n') continue; + streamid++; s++; } else if (*streamid == '$' || *streamid == ';' || *streamid == '\r' || *streamid == '\n') @@ -399,14 +400,14 @@ static void HTTPSV_GenerateQWSVStub(cluster_t *cluster, oproxy_t *dest, char *me { *s = 0; streamid++; - if (*streamid <= ' ') - break; - else if (*streamid >= 'a' && *streamid <= 'f') + if (*streamid >= 'a' && *streamid <= 'f') *s += 10 + *streamid-'a'; else if (*streamid >= 'A' && *streamid <= 'F') *s += 10 + *streamid-'A'; else if (*streamid >= '0' && *streamid <= '9') *s += *streamid-'0'; + else + break; *s <<= 4; @@ -419,7 +420,10 @@ static void HTTPSV_GenerateQWSVStub(cluster_t *cluster, oproxy_t *dest, char *me *s += 10 + *streamid-'A'; else if (*streamid >= '0' && *streamid <= '9') *s += *streamid-'0'; + else + break; + streamid++; s++; } else