Fix some bugs.

This commit is contained in:
Shpoike 2023-02-20 08:53:25 +00:00
parent 832ee6beef
commit 2c8c9b615f
4 changed files with 11 additions and 2 deletions

View file

@ -3534,7 +3534,7 @@ static void SCTP_Decode(sctp_t *sctp, struct icestate_s *peer, ftenet_connection
while ((qbyte*)(c+1) <= msgend)
{
clen = BigShort(c->length);
if ((qbyte*)c + clen > msgend)
if ((qbyte*)c + clen > msgend || clen < sizeof(*c))
break; //corrupt
safeswitch(c->type)
{
@ -3587,7 +3587,7 @@ static void SCTP_Decode(sctp_t *sctp, struct icestate_s *peer, ftenet_connection
if (adv > sctp->i.htsn) //weird maths in case it wraps.
sctp->i.htsn = adv;
sctp->i.r.tsn++;
if (sctp->i.r.size + clen-sizeof(*dc) > sizeof(sctp->i.r.buf))
if (sctp->i.r.size + dlen > sizeof(sctp->i.r.buf))
{
if (net_ice_debug.ival >= 2)
Con_Printf(S_COLOR_GRAY"[%s]: SCTP: Oversized\n", peer->friendlyname);

View file

@ -5826,11 +5826,13 @@ QCC_type_t *QCC_PR_ParseType (int newtype, pbool silentfail)
//swap the class out for the appropriate function type...
newparm = QCC_PR_GenFunctionType(type_void, basetype->params, basetype->num_parms);
parmname = classname;
arraysize = 0;
}
else if (!flag_qcfuncs && basetype == newt && QCC_PR_CheckToken("("))
{
newparm = QCC_PR_ParseFunctionType(false, type_void);
parmname = classname;
arraysize = 0;
}
else
{

View file

@ -835,6 +835,7 @@ void NPP_NQFlush(void)
break;
case svcfte_cgamepacket:
requireextension = PEXT_CSQC;
if (sv_csqcdebug.ival || writedest != &sv.multicast)
{
if (writedest != &sv.multicast)
@ -1919,6 +1920,7 @@ void NPP_QWFlush(void)
break;
case svcfte_cgamepacket:
requireextension = PEXT_CSQC;
if (sv_csqcdebug.ival || writedest != &sv.nqmulticast)
{
if (writedest != &sv.nqmulticast)

View file

@ -3268,6 +3268,11 @@ void SV_PrecacheList_f(void)
{
unsigned int i;
char *group = Cmd_Argv(1);
if (sv.state != ss_active)
{
Con_Printf("Server is not active.\n");
return;
}
#ifdef HAVE_LEGACY
if (!*group || !strncmp(group, "vwep", 4))
{