Commit 53e69c9a authored by CyberLeo's avatar CyberLeo

Fix off-by-one in variable/function parsing

parent 01911d29
......@@ -871,11 +871,11 @@ mesg_parse(int descr, dbref player, dbref what, dbref perms, const char *inbuf,
s = 0;
while (wbuf[p] && wbuf[p] != MFUN_LEADCHAR &&
!isspace(wbuf[p]) && wbuf[p] != MFUN_ARGSTART &&
wbuf[p] != MFUN_ARGEND && s < MAX_MFUN_NAME_LEN) {
wbuf[p] != MFUN_ARGEND && s <= MAX_MFUN_NAME_LEN) {
p++;
s++;
}
if (s < MAX_MFUN_NAME_LEN &&
if ( ( s <= MAX_MFUN_NAME_LEN || ( s <= MAX_MFUN_NAME_LEN + 1 && *ptr == '&' ) ) &&
(wbuf[p] == MFUN_ARGSTART || wbuf[p] == MFUN_ARGEND)) {
int varflag;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment