Skip to content

Commit

Permalink
Closes #611
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed May 6, 2018
1 parent 2fa7655 commit 2e2b931
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rehlds/engine/info.cpp
Expand Up @@ -88,6 +88,7 @@ const char* EXT_FUNC Info_ValueForKey(const char *s, const char *lookup)
s++;
}

size_t keyLen = s - key;
const char* value = ++s; // skip separating slash

// skip value
Expand All @@ -96,7 +97,7 @@ const char* EXT_FUNC Info_ValueForKey(const char *s, const char *lookup)

size_t valueLen = Q_min(s - value, MAX_KV_LEN - 1);

if (!Q_strncmp(key, lookup, lookupLen))
if (keyLen == lookupLen && !Q_strncmp(key, lookup, lookupLen))
{
char* dest = valueBuf[valueIndex];
Q_memcpy(dest, value, valueLen);
Expand Down

0 comments on commit 2e2b931

Please sign in to comment.