On 28.02.2017 19:36, Sebastian Lackner wrote:
> On 28.02.2017 14:14, Jacek Caban wrote:
>> + LIST_FOR_EACH_ENTRY( message, &pipe_end->message_queue, struct pipe_message, entry )
>> + avail += message->iosb->in_size - message->read_pos;
>> + reply_size = min( reply_size, avail );
>> +
>> + if (avail)
>> + {
>> + message = LIST_ENTRY( list_head(&pipe_end->message_queue), struct pipe_message, entry );
>> + reply_size = min( reply_size, message->iosb->in_size );
>> + }
>
> Isn't there a problem with this size check? Lets assume we have two messages
> with 10 byte, for the first one the read_pos = 5. Then avail == 15, and reply_size
> is clamped to 10 - but it will attempt to copy 10 bytes starting position 5?
Yes, you're right, good catch. It definitely needs more tests. I sent a
new version with extended tests.
Thanks,
Jacek
On Tue, Feb 28, 2017 at 11:17:29PM +0000, Alistair Leslie-Hughes wrote:
> --- a/dlls/oledb32/convert.c
> +++ b/dlls/oledb32/convert.c
> @@ -816,23 +816,23 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
> case DBTYPE_STR:
> {
> BSTR b;
> - DBLENGTH bstr_len;
> + DBLENGTH length;
> INT bytes_to_copy;
> - hr = IDataConvert_DataConvert(iface, src_type, DBTYPE_BSTR, src_len, &bstr_len,
> + hr = IDataConvert_DataConvert(iface, src_type, DBTYPE_BSTR, src_len, &length,
> src, &b, sizeof(BSTR), src_status, dst_status,
> precision, scale, flags);
> if(hr != S_OK) return hr;
> - bstr_len = SysStringLen(b);
> - *dst_len = bstr_len * sizeof(char); /* Doesn't include size for '\0' */
> + *dst_len = SysStringLen(b); /* Doesn't include size for '\0' */
You've gone back to confusing the length of a BSTR with the length of
the char * str. We seem to be going round in circles here, so I've
just sent in the correct fix. Please take a look at it to figure
out where you were going wrong.
Huw.
2017-02-28 8:21 GMT-07:00 Matteo Bruni <matteo.mystral(a)gmail.com>:
> 2017-02-27 7:52 GMT+01:00 Alex Henrie <alexhenrie24(a)gmail.com>:
>> diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
>> index 95dd06e466..64b7b8823c 100644
>> --- a/dlls/d3dx9_36/tests/mesh.c
>> +++ b/dlls/d3dx9_36/tests/mesh.c
>> @@ -4340,8 +4340,7 @@ static void test_createtext(IDirect3DDevice9 *device, HDC hdc, const char *text,
>> if (!compute_text_mesh(&mesh, text, deviation, extrusion, otm.otmEMSquare, glyphs))
>> {
>> skip("Couldn't create mesh\n");
>> - d3dxmesh->lpVtbl->Release(d3dxmesh);
>> - return;
>> + goto error;
>> }
>> mesh.fvf = D3DFVF_XYZ | D3DFVF_NORMAL;
>
> I would go in the other direction and strip all the error checking
> branches and gotos from those tests. compute_text_mesh() returns FALSE
> only on allocation failure and that's not supposed to happen in the
> controlled conditions of the test. It's probably better to just fail
> and crash in those cases.
Okay, I won't worry about it then.
-Alex