msi: Prevent call to memset with a null pointer in get_tablecolumns function.

This commit is contained in:
Daniel Beitler 2014-05-18 13:27:42 -04:00 committed by Alexandre Julliard
parent 0fe183c299
commit deb2742267

View File

@ -671,7 +671,7 @@ static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINF
/* Note: _Columns table doesn't have non-persistent data */
/* if maxcount is non-zero, assume it's exactly right for this table */
memset( colinfo, 0, maxcount * sizeof(*colinfo) );
if (colinfo) memset( colinfo, 0, maxcount * sizeof(*colinfo) );
count = table->row_count;
for (i = 0; i < count; i++)
{
@ -684,7 +684,7 @@ static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINF
/* check the column number is in range */
if (col < 1 || col > maxcount)
{
ERR("column %d out of range\n", col);
ERR("column %d out of range (maxcount: %d)\n", col, maxcount);
continue;
}
/* check if this column was already set */