Преглед на файлове

Sicherheitslücke geschlossen

Kolja Strohm преди 6 години
родител
ревизия
5aa561b06c
променени са 2 файла, в които са добавени 6 реда и са изтрити 7 реда
  1. 6 6
      AnmeldungServer/AnmeldungServer.cpp
  2. 0 1
      AnmeldungServer/main.cpp

+ 6 - 6
AnmeldungServer/AnmeldungServer.cpp

@@ -343,14 +343,14 @@ void ASAKlient::thread()
 				if( 1 )
 				{
 					klient->sendeEncrypted( "\1", 1 );
-					char nLen = 0;
-					klient->getNachrichtEncrypted( &nLen, 1 );
+					unsigned char nLen = 0;
+					klient->getNachrichtEncrypted( (char*)&nLen, 1 );
 					char *n = new char[ nLen + 1 ];
 					n[ (int)nLen ] = 0;
 					if( nLen )
 						klient->getNachrichtEncrypted( n, nLen );
-					char pLen = 0;
-					klient->getNachrichtEncrypted( &pLen, 1 );
+					unsigned char pLen = 0;
+					klient->getNachrichtEncrypted( (char*)&pLen, 1 );
 					char *p = new char[ pLen + 1 ];
 					p[ (int)pLen ] = 0;
 					if( pLen )
@@ -1007,9 +1007,9 @@ void ASKlient::thread()
 					}
 					klient->sendeEncrypted( "\1", 1 );
 					int gruppeId = 0;
-					char key = 0;
+					unsigned char key = 0;
 					klient->getNachrichtEncrypted( (char*)&gruppeId, 4 );
-					klient->getNachrichtEncrypted( &key, 1 );
+					klient->getNachrichtEncrypted( (char*)&key, 1 );
 					char *nachricht = new char[ key + 1 ];
 					nachricht[ (int)key ] = 0;
 					if( key )

+ 0 - 1
AnmeldungServer/main.cpp

@@ -3,7 +3,6 @@
 #include <iostream>
 #include <fstream>
 #include <Globals.h>
-#include <sys/socket.h>
 #include <sys/resource.h>
 
 int main()