Commit deb27422 authored by Daniel Beitler's avatar Daniel Beitler Committed by Alexandre Julliard

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

parent 0fe183c2
......@@ -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 */
......
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