]> arthur.barton.de Git - netatalk.git/commitdiff
Possible use of unitialized var
authorFrank Lahm <franklahm@googlemail.com>
Tue, 14 Sep 2010 09:02:16 +0000 (11:02 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Tue, 14 Sep 2010 09:02:16 +0000 (11:02 +0200)
etc/uams/uams_dhx2_passwd.c

index af941d15cef45b39eae4906c0bdd0db72e5cf1b7..c3d43036db3894f255b3ae8f8b232092780a7d55 100644 (file)
@@ -501,6 +501,8 @@ static int logincont2(void *obj _U_, struct passwd **uam_pwd,
     gcry_error_t ctxerror;
 
     *rbuflen = 0;
+    retServerNonce = gcry_mpi_new(0);
+
     /* Packet size should be: Session ID + ServerNonce + Passwd buffer (evantually +10 extra bytes, see Apples Docs)*/
     if ((ibuflen != 2 + 16 + 256) && (ibuflen != 2 + 16 + 256 + 10)) {
         LOG(log_error, logtype_uams, "DHX2: Paket length not correct: %d. Should be 274 or 284.", ibuflen);
@@ -508,8 +510,6 @@ static int logincont2(void *obj _U_, struct passwd **uam_pwd,
         goto error_noctx;
     }
 
-    retServerNonce = gcry_mpi_new(0);
-
     /* Set up our encryption context. */
     ctxerror = gcry_cipher_open( &ctx, GCRY_CIPHER_CAST5, GCRY_CIPHER_MODE_CBC, 0);
     if (gcry_err_code(ctxerror) != GPG_ERR_NO_ERROR) {