[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 03/12] VMDK: probe for monolithicFlat images
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v3 03/12] VMDK: probe for monolithicFlat images |
Date: |
Mon, 27 Jun 2011 05:43:25 +0100 |
On Mon, Jun 27, 2011 at 4:48 AM, Fam Zheng <address@hidden> wrote:
> + if (strncmp("version=1\n", p, strlen("version=1\n")) == 0 ||
> + strncmp("version=1\r\n", p, strlen("version=1\r\n")) == 0 ||
> + strncmp("version=2\n", p, strlen("version=2\n")) == 0 ||
> + strncmp("version=2\r\n", p, strlen("version=2\r\n")) == 0) {
> + return 100;
> + }
If p == end - 1 then this will run off the end of the buffer. You need to use:
strncmp("version=1\n", p, end - p);
Stefan
- [Qemu-devel] [PATCH v3 00/12] Adding VMDK monolithic flat support, Fam Zheng, 2011/06/26
- [Qemu-devel] [PATCH v3 05/12] VMDK: add field BDRVVmdkState.desc_offset, Fam Zheng, 2011/06/26
- [Qemu-devel] [PATCH v3 04/12] VMDK: separate vmdk_open by format version, Fam Zheng, 2011/06/26
- [Qemu-devel] [PATCH v3 07/12] VMDK: move 'static' cid_update flag to bs field, Fam Zheng, 2011/06/26
- [Qemu-devel] [PATCH v3 06/12] VMDK: flush multiple extents, Fam Zheng, 2011/06/26
- [Qemu-devel] [PATCH v3 08/12] VMDK: change get_cluster_offset return type, Fam Zheng, 2011/06/26
- [Qemu-devel] [PATCH v3 10/12] VMDK: create different subformats, Fam Zheng, 2011/06/26
- [Qemu-devel] [PATCH v3 09/12] VMDK: open/read/write for monolithicFlat image, Fam Zheng, 2011/06/26