webservices: Fix reading byte records with 2 and 4 byte length.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2017-06-29 09:22:02 +02:00 committed by Alexandre Julliard
parent c59dd19c4e
commit 119afbd151
1 changed files with 4 additions and 4 deletions

View File

@ -1427,7 +1427,7 @@ static HRESULT read_attribute_value_bin( struct reader *reader, WS_XML_ATTRIBUTE
break;
case RECORD_BYTES16_TEXT:
if ((hr = read_byte( reader, (unsigned char *)&val_uint16 )) != S_OK) return hr;
if ((hr = read_bytes( reader, (unsigned char *)&val_uint16, sizeof(val_uint16) )) != S_OK) return hr;
if (!(utf8 = alloc_utf8_text( NULL, ((4 * val_uint16 / 3) + 3) & ~3 ))) return E_OUTOFMEMORY;
if ((hr = read_encode_base64( reader, val_uint16, utf8->value.bytes, &utf8->value.length )) != S_OK)
{
@ -1437,7 +1437,7 @@ static HRESULT read_attribute_value_bin( struct reader *reader, WS_XML_ATTRIBUTE
break;
case RECORD_BYTES32_TEXT:
if ((hr = read_byte( reader, (unsigned char *)&val_int32 )) != S_OK) return hr;
if ((hr = read_bytes( reader, (unsigned char *)&val_int32, sizeof(val_int32) )) != S_OK) return hr;
if (val_int32 < 0) return WS_E_INVALID_FORMAT;
if (!(utf8 = alloc_utf8_text( NULL, ((4 * val_int32 / 3) + 3) & ~3 ))) return E_OUTOFMEMORY;
if ((hr = read_encode_base64( reader, val_int32, utf8->value.bytes, &utf8->value.length )) != S_OK)
@ -2095,7 +2095,7 @@ static HRESULT read_text_bin( struct reader *reader )
case RECORD_BYTES16_TEXT:
case RECORD_BYTES16_TEXT_WITH_ENDELEMENT:
if ((hr = read_byte( reader, (unsigned char *)&val_uint16 )) != S_OK) return hr;
if ((hr = read_bytes( reader, (unsigned char *)&val_uint16, sizeof(val_uint16) )) != S_OK) return hr;
if (!(node = alloc_text_node( NULL, ((4 * val_uint16 / 3) + 3) & ~3, &utf8 ))) return E_OUTOFMEMORY;
if ((hr = read_encode_base64( reader, val_uint16, utf8->value.bytes, &utf8->value.length )) != S_OK)
{
@ -2106,7 +2106,7 @@ static HRESULT read_text_bin( struct reader *reader )
case RECORD_BYTES32_TEXT:
case RECORD_BYTES32_TEXT_WITH_ENDELEMENT:
if ((hr = read_byte( reader, (unsigned char *)&val_int32 )) != S_OK) return hr;
if ((hr = read_bytes( reader, (unsigned char *)&val_int32, sizeof(val_int32) )) != S_OK) return hr;
if (val_int32 < 0) return WS_E_INVALID_FORMAT;
if (!(node = alloc_text_node( NULL, ((4 * val_int32 / 3) + 3) & ~3, &utf8 ))) return E_OUTOFMEMORY;
if ((hr = read_encode_base64( reader, val_int32, utf8->value.bytes, &utf8->value.length )) != S_OK)