|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
From 89053aff0cc36dfcee6fda6e83b13f6f68c05a82 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
Date: Thu, 12 Jun 2014 22:50:04 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
Subject: [PATCH] cryptsetup: check that password is not null
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
Beef up the assert to protect against passing null to strlen.
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
Found with scan-build.
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
(cherry picked from commit f268f57f6344d3a2ccf447352ff3ed1313c4a199)
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
src/cryptsetup/cryptsetup.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
index 812b32f6..a67d85e6 100644
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
--- a/src/cryptsetup/cryptsetup.c
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
+++ b/src/cryptsetup/cryptsetup.c
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
@@ -344,7 +344,7 @@ static int attach_tcrypt(struct crypt_device *cd,
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
assert(cd);
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
assert(name);
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
- assert(key_file || passwords);
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
+ assert(key_file || (passwords && passwords[0]));
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
if (arg_tcrypt_hidden)
|
|
Zbigniew Jędrzejewski-Szmek |
5509c0 |
params.flags |= CRYPT_TCRYPT_HIDDEN_HEADER;
|