Browse Source

Sicherheitslücke geschlossen

Kolja Strohm 6 years ago
parent
commit
a8342ecc72
1 changed files with 18 additions and 18 deletions
  1. 18 18
      Minigame Server/MinigameServer.cpp

+ 18 - 18
Minigame Server/MinigameServer.cpp

@@ -344,14 +344,14 @@ void MSAKlient::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 )
@@ -706,8 +706,8 @@ void MSKlient::thread()
             case 0x6: // Get Minigame Option List
             {
                 klient->sendeEncrypted( "\1", 1 );
-                char l = 0;
-                klient->getNachrichtEncrypted( &l, 1 );
+                unsigned char l = 0;
+                klient->getNachrichtEncrypted( (char*)&l, 1 );
                 char *mName = new char[ l ];
                 mName[ (int)l ] = 0;
                 klient->getNachrichtEncrypted( mName, l );
@@ -726,8 +726,8 @@ void MSKlient::thread()
             case 0x7: // Get Minigame Bestscore List
             {
                 klient->sendeEncrypted( "\1", 1 );
-                char l = 0;
-                klient->getNachrichtEncrypted( &l, 1 );
+                unsigned char l = 0;
+                klient->getNachrichtEncrypted( (char*)&l, 1 );
                 char *mName = new char[ l ];
                 mName[ (int)l ] = 0;
                 klient->getNachrichtEncrypted( mName, l );
@@ -753,12 +753,12 @@ void MSKlient::thread()
             case 0x8: // Get Minigame Option Bestscore
             {
                 klient->sendeEncrypted( "\1", 1 );
-                char l = 0;
-                klient->getNachrichtEncrypted( &l, 1 );
+                unsigned char l = 0;
+                klient->getNachrichtEncrypted( (char*)&l, 1 );
                 char *mName = new char[ l ];
                 mName[ (int)l ] = 0;
                 klient->getNachrichtEncrypted( mName, l );
-                klient->getNachrichtEncrypted( &l, 1 );
+                klient->getNachrichtEncrypted( (char*)&l, 1 );
                 char *oName = new char[ l ];
                 oName[ (int)l ] = 0;
                 klient->getNachrichtEncrypted( oName, l );
@@ -783,12 +783,12 @@ void MSKlient::thread()
                     break;
                 }
                 klient->sendeEncrypted( "\1", 1 );
-                char l = 0;
-                klient->getNachrichtEncrypted( &l, 1 );
+                unsigned char l = 0;
+                klient->getNachrichtEncrypted( (char*)&l, 1 );
                 char *mName = new char[ l ];
                 mName[ (int)l ] = 0;
                 klient->getNachrichtEncrypted( mName, l );
-                klient->getNachrichtEncrypted( &l, 1 );
+                klient->getNachrichtEncrypted( (char*)&l, 1 );
                 char *oName = new char[ l ];
                 oName[ (int)l ] = 0;
                 klient->getNachrichtEncrypted( oName, l );
@@ -834,12 +834,12 @@ void MSKlient::thread()
             case 0xA: // Get Minigame Capture
             {
                 klient->sendeEncrypted( "\1", 1 );
-                char l = 0;
-                klient->getNachrichtEncrypted( &l, 1 );
+                unsigned char l = 0;
+                klient->getNachrichtEncrypted( (char*)&l, 1 );
                 char *mName = new char[ l ];
                 mName[ (int)l ] = 0;
                 klient->getNachrichtEncrypted( mName, l );
-                klient->getNachrichtEncrypted( &l, 1 );
+                klient->getNachrichtEncrypted( (char*)&l, 1 );
                 char *oName = new char[ l ];
                 oName[ (int)l ] = 0;
                 klient->getNachrichtEncrypted( oName, l );
@@ -917,7 +917,7 @@ void MSKlient::thread()
                             }
                             if( ret == 3 )
                             {
-                                k->getNachrichtEncrypted( &l, 1 );
+                                k->getNachrichtEncrypted( (char*)&l, 1 );
                                 char *error = new char[ l + 1 ];
                                 error[ (int)l ] = 0;
                                 k->getNachrichtEncrypted( error, l );