From 7e3adf79eb8ef4ec9d733e014e6adb0f7d156974 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martti=20Rannanj=C3=A4rvi?= Date: Thu, 4 Aug 2016 17:39:02 +0300 Subject: [PATCH] lib-dcrypt: don't give strstr NULL in test-crypto --- src/lib-dcrypt/test-crypto.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/lib-dcrypt/test-crypto.c b/src/lib-dcrypt/test-crypto.c index 401c38ad56..6f79a1977b 100644 --- a/src/lib-dcrypt/test-crypto.c +++ b/src/lib-dcrypt/test-crypto.c @@ -572,24 +572,21 @@ void test_get_info_invalid_keys(void) { 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(); } -- 2.47.3