Skip to content

Commit afe0f00

Browse files
committed
dt: Notify player why his client crashed if malicious server send bad CUtlVector length
1 parent 68c8b82 commit afe0f00

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/public/dt_utlvector_recv.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ void RecvProxy_UtlVectorLength( const CRecvProxyData *pData, void *pStruct, void
3636
// to write arbitrary data to out of bounds memory.
3737
// There isn't much we can do at this point - we're deep in the networking stack, it's hard to recover
3838
// gracefully and we shouldn't be talking to this server anymore.
39-
// So we crash.
39+
//
40+
// So we notify client.
41+
Error("Server send utlvector length value %d which is not in range [%d...%d]. Crashing client to prevent RCE...\n",
42+
pData->m_Value.m_Int, 0, pExtra->m_nMaxElements);
43+
// And crash.
4044
*(int *) 1 = 2;
4145
}
4246
pExtra->m_ResizeFn( pStruct, pExtra->m_Offset, pData->m_Value.m_Int );

0 commit comments

Comments
 (0)