diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-04-28 21:09:32 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-04-28 21:09:32 +0000 |
commit | 712e78744e3a0332825a80298f38225b30dec88c (patch) | |
tree | a2b59da7629b13843649281332fd0cf8be1267c2 /block-cow.c | |
parent | 7c35359cbf4eaa1d808a1ebb3647fe65fcc9dc60 (diff) | |
download | qemu-712e78744e3a0332825a80298f38225b30dec88c.zip qemu-712e78744e3a0332825a80298f38225b30dec88c.tar.gz qemu-712e78744e3a0332825a80298f38225b30dec88c.tar.bz2 |
probing fixes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1425 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block-cow.c')
-rw-r--r-- | block-cow.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block-cow.c b/block-cow.c index 15270df..eeeab70 100644 --- a/block-cow.c +++ b/block-cow.c @@ -54,7 +54,8 @@ static int cow_probe(const uint8_t *buf, int buf_size, const char *filename) { const struct cow_header_v2 *cow_header = (const void *)buf; - if (be32_to_cpu(cow_header->magic) == COW_MAGIC && + if (buf_size >= sizeof(struct cow_header_v2) && + be32_to_cpu(cow_header->magic) == COW_MAGIC && be32_to_cpu(cow_header->version) == COW_VERSION) return 100; else |