Commit 1257db21 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Fix integer conversion in get_table_value_from_record.

parent 7dfdcf30
...@@ -1259,6 +1259,7 @@ static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT ...@@ -1259,6 +1259,7 @@ static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT
{ {
MSICOLUMNINFO columninfo; MSICOLUMNINFO columninfo;
UINT r; UINT r;
int ival;
if ( (iField <= 0) || if ( (iField <= 0) ||
(iField > tv->num_cols) || (iField > tv->num_cols) ||
...@@ -1285,16 +1286,21 @@ static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT ...@@ -1285,16 +1286,21 @@ static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT
} }
else if ( bytes_per_column( tv->db, &columninfo, LONG_STR_BYTES ) == 2 ) else if ( bytes_per_column( tv->db, &columninfo, LONG_STR_BYTES ) == 2 )
{ {
*pvalue = 0x8000 + MSI_RecordGetInteger( rec, iField ); ival = MSI_RecordGetInteger( rec, iField );
if ( *pvalue & 0xffff0000 ) if (ival == 0x80000000) *pvalue = 0x8000;
else
{ {
ERR("field %u value %d out of range\n", iField, *pvalue - 0x8000); *pvalue = 0x8000 + MSI_RecordGetInteger( rec, iField );
return ERROR_FUNCTION_FAILED; if (*pvalue & 0xffff0000)
{
ERR("field %u value %d out of range\n", iField, *pvalue - 0x8000);
return ERROR_FUNCTION_FAILED;
}
} }
} }
else else
{ {
INT ival = MSI_RecordGetInteger( rec, iField ); ival = MSI_RecordGetInteger( rec, iField );
*pvalue = ival ^ 0x80000000; *pvalue = ival ^ 0x80000000;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment