projects
/
platform
/
upstream
/
cryptsetup.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6874f56
)
Proper handle error in device block get.
author
Milan Broz
<gmazyland@gmail.com>
Tue, 28 Aug 2012 11:30:17 +0000
(13:30 +0200)
committer
Milan Broz
<gmazyland@gmail.com>
Tue, 28 Aug 2012 11:30:17 +0000
(13:30 +0200)
lib/luks1/keyencryption.c
patch
|
blob
|
history
diff --git
a/lib/luks1/keyencryption.c
b/lib/luks1/keyencryption.c
index cfc0f10db624ee12ca9a7c87bf587bc7e609dad9..84303ea44598953040acb4053ab1aee3bbdc1a48 100644
(file)
--- a/
lib/luks1/keyencryption.c
+++ b/
lib/luks1/keyencryption.c
@@
-110,9
+110,12
@@
static int LUKS_endec_template(char *src, size_t srcLength,
int r = -1;
int bsize = device_block_size(crypt_metadata_device(ctx));
+ if (bsize <= 0)
+ return -EINVAL;
+
if(dmDir == NULL) {
log_err(ctx, _("Failed to obtain device mapper directory."));
- return -
1
;
+ return -
EINVAL
;
}
if(asprintf(&name,"temporary-cryptsetup-%d",getpid()) == -1 ||
asprintf(&fullpath,"%s/%s",dmDir,name) == -1 ||