Hi,
The mistake here is that this is done with memcpy, which will copy all bits
without checking. It is not writing, therefore no memory corruption, as I
stated, but the copied data in Octstr is invalid and has the wrong length.
Not a biggie if you are using it as a C string, but quite messy if you use
it as Octstr.
BR,
Nikos
----- Original Message -----
From: "Vincent CHAVANIS" <[email protected]>
To: "Nikos Balkanas" <[email protected]>
Cc: <[email protected]>
Sent: Friday, March 27, 2009 10:05 PM
Subject: Re: gwlib/http.c patch
Hi nikos,
I could not understand this patch !?
If `from+len' is after the end of `ostr', `len' is reduced appropriately.
So what's wrong here ?
Vincent.
Nikos Balkanas a Γ©crit :
Hi,
A small patch that left as it is should lead to memory corruption. I
have not tested the broken code but it seems quite obvious to me. Please
vote & decide.
BR,
Nikos