summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-20 09:15:01 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-20 09:15:01 +0000
commitccfcdda27482fe2ac99d0da936ef1a1374223624 (patch)
treebb5e7fb0f8178b751b3a22192bd1d82e04541104 /src/configreader.cpp
parentca781714c1651a9e7042eb930c6b117449f8e1fc (diff)
Fix potential off-by-one on large reads (thanks psychon)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10048 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 117546f09..5ee89af23 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -375,7 +375,8 @@ bool ValidateServerName(ServerConfig* conf, const char*, const char*, ValueItem
bool ValidateNetBufferSize(ServerConfig* conf, const char*, const char*, ValueItem &data)
{
- if ((!data.GetInteger()) || (data.GetInteger() > 65535) || (data.GetInteger() < 1024))
+ // 65534 not 65535 because of null terminator
+ if ((!data.GetInteger()) || (data.GetInteger() > 65534) || (data.GetInteger() < 1024))
{
conf->GetInstance()->Logs->Log("CONFIG",DEFAULT,"No NetBufferSize specified or size out of range, setting to default of 10240.");
data.Set(10240);