From 22e3aa9ed68c646050888d108257ff7fa6216910 Mon Sep 17 00:00:00 2001 From: codeworkx Date: Tue, 23 Apr 2019 12:02:26 +0200 Subject: ext4crypt: add missing cflag Avoid calling e4crypt_prepare_user_storage with wrong input parameters. Change-Id: I5c8945370cb642e46f08c65090c0290c15fe0b57 libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 632 (recovery), pid 564 (recovery) --- crypto/ext4crypt/Decrypt.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crypto/ext4crypt/Decrypt.cpp') diff --git a/crypto/ext4crypt/Decrypt.cpp b/crypto/ext4crypt/Decrypt.cpp index 3eeaaf877..e69b64793 100644 --- a/crypto/ext4crypt/Decrypt.cpp +++ b/crypto/ext4crypt/Decrypt.cpp @@ -1336,7 +1336,11 @@ bool Decrypt_User(const userid_t user_id, const std::string& Password) { printf("e4crypt_unlock_user_key returned fail\n"); return false; } - if (!e4crypt_prepare_user_storage(nullptr, user_id, 0, flags)) { +#ifdef USE_KEYSTORAGE_4 + if (!e4crypt_prepare_user_storage("", user_id, 0, flags)) { +#else + if (!e4crypt_prepare_user_storage(nullptr, user_id, 0, flags)) { +#endif printf("failed to e4crypt_prepare_user_storage\n"); return false; } -- cgit v1.2.3