Mercurial > dovecot > core-2.2
changeset 20581:e8a810c9c96c
lib-dcrypt: don't give strstr NULL in test-crypto
author | Martti Rannanjärvi <martti.rannanjarvi@dovecot.fi> |
---|---|
date | Thu, 04 Aug 2016 17:39:02 +0300 |
parents | 550ed4230b05 |
children | 3e02c55136a6 |
files | src/lib-dcrypt/test-crypto.c |
diffstat | 1 files changed, 3 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-dcrypt/test-crypto.c Fri Jul 15 09:53:12 2016 +0200 +++ b/src/lib-dcrypt/test-crypto.c Thu Aug 04 17:39:02 2016 +0300 @@ -572,24 +572,21 @@ test_assert(dcrypt_key_string_get_info(key, NULL, NULL, NULL, NULL, NULL, NULL, &error) == FALSE); - test_assert(error != NULL); - test_assert(strstr(error, "tab") != NULL); + test_assert(error != NULL && strstr(error, "tab") != NULL); key = "2\t305e301006072a8648ce3d020106052b81040026034a000203fcc90034fa03d6fb79a0fc8b3b43c3398f68e76029307360cdcb9e27bb7e84b3c19dfb7244763bc4d442d216f09b7b7945ed9d182f3156550e9ee30b237a0217dbf79d28975f31\t86706b69d1f640011a65d26a42f2ba20a619173644e1cc7475eb1d90966e84dc"; error = NULL; test_assert(dcrypt_key_string_get_info(key, NULL, NULL, NULL, NULL, NULL, NULL, &error) == FALSE); - test_assert(error != NULL); - test_assert(strstr(error, "colon") != NULL); + test_assert(error != NULL && strstr(error, "colon") != NULL); key = "2"; error = NULL; test_assert(dcrypt_key_string_get_info(key, NULL, NULL, NULL, NULL, NULL, NULL, &error) == FALSE); - test_assert(error != NULL); - test_assert(strstr(error, "Unknown") != NULL); + test_assert(error != NULL && strstr(error, "Unknown") != NULL); test_end(); }