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:
104c7d6
)
Fix malloc of 0 size.
author
Milan Broz
<gmazyland@gmail.com>
Mon, 18 Jun 2012 13:03:47 +0000
(15:03 +0200)
committer
Milan Broz
<gmazyland@gmail.com>
Mon, 18 Jun 2012 13:03:47 +0000
(15:03 +0200)
src/cryptsetup_reencrypt.c
patch
|
blob
|
history
diff --git
a/src/cryptsetup_reencrypt.c
b/src/cryptsetup_reencrypt.c
index
f5f33da
..
fa6ce13
100644
(file)
--- a/
src/cryptsetup_reencrypt.c
+++ b/
src/cryptsetup_reencrypt.c
@@
-317,7
+317,7
@@
static int create_empty_header(const char *new_file, const char *old_file,
log_dbg("Creating empty file %s of size %lu.", new_file, (unsigned long)size);
- if (!(buf = malloc(size)))
+ if (!
size || !
(buf = malloc(size)))
return -ENOMEM;
memset(buf, 0, size);