projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dcf99fe
)
* checking whether cdb->len == 0 was missing as abort precondition
author
Wilfried Göesgens
<willi@citadel.org>
Wed, 27 Jan 2010 23:23:58 +0000
(23:23 +0000)
committer
Wilfried Göesgens
<willi@citadel.org>
Wed, 27 Jan 2010 23:23:58 +0000
(23:23 +0000)
citadel/database.c
patch
|
blob
|
history
diff --git
a/citadel/database.c
b/citadel/database.c
index 4c049f60e86edd77653566d72234290adc6ab613..ed9019288534c18f594f325eef25f0c45fb42d6b 100644
(file)
--- a/
citadel/database.c
+++ b/
citadel/database.c
@@
-491,12
+491,11
@@
void cdb_decompress_if_necessary(struct cdbdata *cdb)
{
static int magic = COMPRESS_MAGIC;
- if (cdb == NULL)
- return;
- if (cdb->ptr == NULL)
- return;
- if (memcmp(cdb->ptr, &magic, sizeof(magic)))
- return;
+ if ((cdb == NULL) ||
+ (cdb->ptr == NULL) ||
+ (cdb->len == 0) ||
+ (memcmp(cdb->ptr, &magic, sizeof(magic))))
+ return;
#ifdef HAVE_ZLIB
/* At this point we know we're looking at a compressed item. */