]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-sasl: Do not crash if password is NULL
authorAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 11 Aug 2021 06:59:05 +0000 (09:59 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 13 Aug 2021 06:46:44 +0000 (09:46 +0300)
src/lib-sasl/dsasl-client.c

index 6d0c130b070a336759757c9be358ec4d18795e78..fc92f44a80628a7354cb235b420c5d4ce9d8e3d3 100644 (file)
@@ -78,7 +78,8 @@ void dsasl_client_free(struct dsasl_client **_client)
 
        if (client->mech->free != NULL)
                client->mech->free(client);
-       safe_memset(client->password, 0, strlen(client->password));
+       if (client->password != NULL)
+               safe_memset(client->password, 0, strlen(client->password));
        pool_unref(&client->pool);
 }