]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Eliminated password file descriptor leak.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 4 May 2014 10:17:34 +0000 (12:17 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 4 May 2014 10:17:34 +0000 (12:17 +0200)
Issue discovered using codenomicon TLS test suite.

lib/auth/psk_passwd.c

index c553b4a26b83388136ddcce1923be483f6b5f125..5c10997ba9e0b556168c5e9dff991ab237fd665f 100644 (file)
@@ -185,17 +185,16 @@ _gnutls_psk_pwd_find_entry(gnutls_session_t session, char *username,
                                ret = GNUTLS_E_SRP_PWD_ERROR;
                                goto cleanup;
                        }
-                       return 0;
+                       ret = 0;
+                       goto cleanup;
                }
        }
 
        /* user was not found. Fake him. 
-        * the last index found and randomize the entry.
         */
        ret = _randomize_psk(psk);
        if (ret < 0) {
                goto cleanup;
-               return ret;
        }
 
        ret = 0;