Commit b8818e3
committed
Fix crash in SV_SetClient_Ping by pre-linking client pointers
SV_CalcPings in the engine can run before ClientConnect has fully linked
the entity to the client structure, causing a null pointer dereference
when accessing client->edict->client->ping.
This change ensures that g_entities[i].client pointers are set immediately
upon client array allocation in AllocateClientArray, and cleared in
FreeClientArray. This guarantees that valid client slots always have
a valid client pointer for the engine to access.1 parent f020431 commit b8818e3
1 file changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
67 | 75 | | |
68 | 76 | | |
69 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
70 | 85 | | |
71 | 86 | | |
72 | 87 | | |
| |||
0 commit comments