Update of /cvsroot/wpdev/wolfpack/network
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28084/network
Modified Files:
uorxpackets.cpp uosocket.cpp
Log Message:
fixes
Index: uosocket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v
retrieving revision 1.418
retrieving revision 1.419
diff -C2 -d -r1.418 -r1.419
*** uosocket.cpp 25 Sep 2004 19:57:12 -0000 1.418
--- uosocket.cpp 25 Sep 2004 21:15:47 -0000 1.419
***************
*** 2541,2545 ****
std::vector<unsigned int> switches = packet->choice().switches;
! if (!target && switches.size() != 0) {
target = World::instance()->findChar(switches[0]);
}
--- 2541,2545 ----
std::vector<unsigned int> switches = packet->choice().switches;
! if (switches.size() == 1) {
target = World::instance()->findChar(switches[0]);
}
***************
*** 2558,2562 ****
if ( it == gumps.end() )
{
! sysMessage( tr( "Unexpected button input" ) );
return;
}
--- 2558,2562 ----
if ( it == gumps.end() )
{
! sysMessage( tr( "Unexpected button input." ) );
return;
}
Index: uorxpackets.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uorxpackets.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** uorxpackets.cpp 19 Aug 2004 01:22:56 -0000 1.65
--- uorxpackets.cpp 25 Sep 2004 21:15:47 -0000 1.66
***************
*** 195,198 ****
--- 195,203 ----
choice.button = getInt( 11 );
Q_UINT32 numSwitches = getInt( 15 );
+
+ if (numSwitches > 2000) {
+ return choice;
+ }
+
Q_UINT32 i;
for ( i = 0; i < numSwitches; i++ )
***************
*** 200,205 ****
choice.switches.push_back( getInt( 19 + 4 * i ) );
}
! Q_UINT32 numTextEntries = getInt( 19 + 4 * numSwitches );
! Q_UINT32 offset = 0;
for ( i = 0; i < numTextEntries; i++ )
{
--- 205,222 ----
choice.switches.push_back( getInt( 19 + 4 * i ) );
}
!
! Q_UINT32 offset = 19 + 4 * numSwitches;
!
! if (offset >= size()) {
! return choice;
! }
!
! Q_UINT32 numTextEntries = getInt( offset );
!
! if (numTextEntries > 2000) {
! return choice;
! }
!
! offset = 0;
for ( i = 0; i < numTextEntries; i++ )
{
|