diff options
Diffstat (limited to 'gck/gck-mock.c')
-rw-r--r-- | gck/gck-mock.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gck/gck-mock.c b/gck/gck-mock.c index a6a60b2..a1fdba9 100644 --- a/gck/gck-mock.c +++ b/gck/gck-mock.c @@ -721,13 +721,17 @@ gck_mock_C_SetPIN (CK_SESSION_HANDLE hSession, CK_UTF8CHAR_PTR pOldPin, CK_ULONG ulOldLen, CK_UTF8CHAR_PTR pNewPin, CK_ULONG ulNewLen) { Session *session; + gboolean match; gchar *old; session = g_hash_table_lookup (the_sessions, GUINT_TO_POINTER (hSession)); g_return_val_if_fail (session, CKR_SESSION_HANDLE_INVALID); old = g_strndup ((gchar*)pOldPin, ulOldLen); - if (!old || !g_str_equal (old, the_pin)) + match = old && g_str_equal (old, the_pin); + g_free (old); + + if (!match) return CKR_PIN_INCORRECT; g_free (the_pin); |