[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/32] vmdk: Fix vmdk_parse_extents
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 11/32] vmdk: Fix vmdk_parse_extents |
Date: |
Wed, 4 Dec 2013 08:34:18 -0600 |
From: Fam Zheng <address@hidden>
An extra 'p++' after while loop when *p == '\n' will move p to unknown
data position, risking parsing junk data or memory access violation.
Cc: address@hidden
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
(cherry picked from commit 899f1ae219d5eaa96a53c996026cb0178d62a86d)
Signed-off-by: Michael Roth <address@hidden>
---
block/vmdk.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index 258a24f..dcee07a 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -755,10 +755,13 @@ static int vmdk_parse_extents(const char *desc,
BlockDriverState *bs,
}
next_line:
/* move to next line */
- while (*p && *p != '\n') {
+ while (*p) {
+ if (*p == '\n') {
+ p++;
+ break;
+ }
p++;
}
- p++;
}
return 0;
}
--
1.7.9.5
- [Qemu-devel] [PATCH 28/32] qom: Fix memory leak in object_property_set_link(), (continued)
- [Qemu-devel] [PATCH 28/32] qom: Fix memory leak in object_property_set_link(), Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 13/32] monitor: eliminate monitor_event_state_lock, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 27/32] virtio-net: fix the memory leak in rxfilter_notify(), Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 21/32] virtio-net: only delete bh that existed, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 24/32] qcow2: count_contiguous_clusters and compression, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 25/32] qcow2: fix possible corruption when reading multiple clusters, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 20/32] linux-user: Fix stat64 syscall for SPARC64, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 14/32] memory: fix 128 arithmetic in info mtree, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 19/32] configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 17/32] qapi: fix memleak by adding implict struct functions in dealloc visitor, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 11/32] vmdk: Fix vmdk_parse_extents,
Michael Roth <=
- [Qemu-devel] [PATCH 15/32] Adjust qapi-visit for python-2.4.3, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 18/32] tests: fix memleak in error path test for input visitor, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 23/32] Fix pc migration from qemu <= 1.5, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 16/32] configure: detect endian via compile test, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 22/32] exec: fix breakpoint_invalidate when pc may not be translated, Michael Roth, 2013/12/04
- Re: [Qemu-devel] Patch Round-up for stable 1.6.2, freeze on 2013-12-06, Paolo Bonzini, 2013/12/05