qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 09/12] VMDK: open/read/write for monolithicFl


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v5 09/12] VMDK: open/read/write for monolithicFlat image
Date: Thu, 30 Jun 2011 07:13:22 +0100

On Thu, Jun 30, 2011 at 2:57 AM, Fam Zheng <address@hidden> wrote:
> On Wed, Jun 29, 2011 at 11:57 PM, Stefan Hajnoczi <address@hidden> wrote:
>> On Tue, Jun 28, 2011 at 2:32 AM, Fam Zheng <address@hidden> wrote:
>>> +        /* trim the quotation marks around */
>>> +        if (fname[0] == '"') {
>>> +            memmove(fname, fname + 1, strlen(fname) + 1);
>>
>> This copies 1 byte too many, just strlen(fname) will do.
> I meant to copy the NULL terminator too.

Yes.  The problem is the copying starts at fname + 1 but strlen(3)
starts at fname.  So there is already an extra byte.  The + 1 adds an
additional byte after the NUL.


Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]