* Initialize our variables before usage; this should prevent out-of-bound array accesses when a player in a multiplayer game designs a new design template
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1943 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
f73ff26ebf
commit
072395e2df
|
@ -1326,7 +1326,7 @@ BOOL sendTemplate(DROID_TEMPLATE *pTempl)
|
|||
}
|
||||
NetAddUint32(m, count, pTempl->droidType); count += 4;
|
||||
NetAddUint32(m, count, pTempl->multiPlayerID); count += 4;
|
||||
|
||||
|
||||
m.type = NET_TEMPLATE;
|
||||
m.size = count;
|
||||
return( NETbcast(&m,FALSE) );
|
||||
|
@ -1338,7 +1338,8 @@ BOOL recvTemplate(NETMSG * m)
|
|||
UBYTE player;
|
||||
DROID_TEMPLATE *psTempl;
|
||||
DROID_TEMPLATE t, *pT = &t;
|
||||
UDWORD count, i;
|
||||
unsigned int i;
|
||||
unsigned int count = 0;
|
||||
|
||||
NetGetUint8(m, count, player); count += 1;
|
||||
ASSERT( player < MAX_PLAYERS, "recvtemplate: invalid player size: %d", player );
|
||||
|
|
Loading…
Reference in New Issue