Index: code/branches/network/src/network/ClientInformation.h
===================================================================
--- code/branches/network/src/network/ClientInformation.h	(revision 1431)
+++ code/branches/network/src/network/ClientInformation.h	(revision 1432)
@@ -48,4 +48,6 @@
 #define GAMESTATEID_INITIAL -1
 #define CLIENTID_UNKNOWN -2
+
+// WATCH OUT: THE CLIENTINFORMATION LIST IS NOT THREADSAFE ANYMORE
 
 namespace network
Index: code/branches/network/src/network/GameStateClient.cc
===================================================================
--- code/branches/network/src/network/GameStateClient.cc	(revision 1431)
+++ code/branches/network/src/network/GameStateClient.cc	(revision 1432)
@@ -238,4 +238,6 @@
     }
     //retval->data = (unsigned char*)malloc(size);
+    if(size==0)
+      return NULL;
     retval->data = new unsigned char[size];
     if(!retval->data){
@@ -283,4 +285,6 @@
       dest_length=diff->size;
 //     unsigned char *dp = (unsigned char *)malloc(dest_length*sizeof(unsigned char));
+    if(dest_length==0)
+      return NULL;
     unsigned char *dp = new unsigned char[dest_length*sizeof(unsigned char)];
     while(of<old->size && of<diff->size){
@@ -322,4 +326,6 @@
 
     uLongf buffer = (uLongf)((a->size + 12)*1.01)+1;
+    if(buffer==0)
+      return NULL;
     unsigned char *dest = new unsigned char[buffer];
     int retval;
@@ -358,4 +364,6 @@
       bufsize = normsize;
 //     unsigned char* dest = (unsigned char*)malloc( bufsize );
+    if(bufsize==0)
+      return NULL;
     unsigned char *dest = new unsigned char[bufsize];
     int retval;
Index: code/branches/network/src/network/GameStateManager.cc
===================================================================
--- code/branches/network/src/network/GameStateManager.cc	(revision 1431)
+++ code/branches/network/src/network/GameStateManager.cc	(revision 1432)
@@ -193,4 +193,6 @@
     }
     //retval->data = (unsigned char*)malloc(size);
+    if(size==0)
+      return NULL;
     retval->data = new unsigned char[size];
     if(!retval->data){
@@ -347,4 +349,6 @@
     else*/
       dest_length=neu->size;
+    if(dest_length==0)
+      return NULL;
     //unsigned char *dp = (unsigned char *)malloc(dest_length*sizeof(unsigned char));
     unsigned char *dp = new unsigned char[dest_length*sizeof(unsigned char)];
@@ -387,4 +391,6 @@
     //COUT(4) << "size: " << size << ", buffer: " << buffer << std::endl;
     //unsigned char* dest = (unsigned char*)malloc( buffer );
+    if(buffer==0)
+      return NULL;
     unsigned char *dest = new unsigned char[buffer];
     //COUT(4) << "dest: " << dest << std::endl;
@@ -429,4 +435,6 @@
       bufsize = normsize;
 //     unsigned char* dest = (unsigned char*)malloc( bufsize );
+    if(bufsize==0)
+      return NULL;
     unsigned char *dest = new unsigned char[bufsize];
     int retval;
Index: code/branches/network/src/network/PacketDecoder.cc
===================================================================
--- code/branches/network/src/network/PacketDecoder.cc	(revision 1431)
+++ code/branches/network/src/network/PacketDecoder.cc	(revision 1432)
@@ -127,4 +127,6 @@
   bool PacketDecoder::command( ENetPacket* packet, int clientId ){
     int length = *(int*)((unsigned char *)packet->data+sizeof(int));
+    if(length<=0)
+      return false;
     void *data = (void *)new unsigned char[length];
     memcpy(data, (void *)(packet->data+2*sizeof(int)), length);
@@ -158,4 +160,6 @@
   {
     chat* chatting = new chat;
+    if(packet->dataLength==4)
+      return;
     chatting->id = (int)*packet->data; //first copy id into new struct
     //since the chat message is a char*, allocate the memory needed
@@ -204,4 +208,6 @@
       COUT(2) << "PacketDecoder: compsize is 0" << std::endl;
 //     currentState->data = (unsigned char*)(malloc( currentState->compsize ));
+    if(currentState->compsize==0)
+      return;
     currentState->data = new unsigned char[currentState->compsize];
     if(currentState->data==NULL)
@@ -221,4 +227,6 @@
     cid->id = ((classid *)(packet->data))->id;
     cid->clid = ((classid *)(packet->data))->clid;
+    if(cid->length==0)
+      return;
 //     cid->message = (const char *)malloc(cid->length);
     cid->message = new char[cid->length];
Index: code/branches/network/src/network/PacketGenerator.cc
===================================================================
--- code/branches/network/src/network/PacketGenerator.cc	(revision 1431)
+++ code/branches/network/src/network/PacketGenerator.cc	(revision 1432)
@@ -89,4 +89,6 @@
   ENetPacket* command( int dataLength, void *data, int reliable = ENET_PACKET_FLAG_RELIABLE )
   {
+    if(dataLength==0)
+      return NULL;
     unsigned char *stream = new unsigned char[dataLength + 2*sizeof(int)];
     if(!stream)
@@ -150,4 +152,6 @@
     //std::cout << "totalLen " << totalLen << std::endl;
     //unsigned char *data = (unsigned char*)malloc( totalLen ); //allocate the memory for datastream
+    if(totalLen==0)
+      return NULL;
     unsigned char *data = new unsigned char[totalLen];
     memcpy( (void*)(data), (const void*)&gid, sizeof( int ) ); //this is the enet id
@@ -173,4 +177,6 @@
   {
     //unsigned char* data = (unsigned char *)malloc(3*sizeof(int)+classname.length()+1);
+    if(classname.length()==0)
+      return NULL;
     unsigned char *data = new unsigned char[3*sizeof(int)+classname.length()+1];
     std::cout << "PacketGenerator: classid: " << classid << ", name: " << classname << std::endl;
Index: code/branches/network/src/orxonox/Orxonox.cc
===================================================================
--- code/branches/network/src/orxonox/Orxonox.cc	(revision 1431)
+++ code/branches/network/src/orxonox/Orxonox.cc	(revision 1432)
@@ -494,5 +494,5 @@
         renderTime = 0.0f;
       }
-
+      
       // Call those objects that need the real time
       for (Iterator<TickableReal> it = ObjectList<TickableReal>::start(); it; ++it)
