Skip to content

Commit

Permalink
Fix some bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shpoike committed Apr 17, 2023
1 parent 832ee6b commit 2c8c9b6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engine/common/net_ice.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions engine/qclib/qcc_pr_lex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 2 additions & 0 deletions engine/server/net_preparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions engine/server/sv_ccmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down

0 comments on commit 2c8c9b6

Please sign in to comment.