0001-Prevent-call-to-memset-with-a-null-pointer.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. commit deb274226783ab886bdb44876944e156757efe2b
  2. Author: Daniel Beitler <dan@dablabs.com>
  3. Date: Sun May 18 13:27:42 2014 -0400
  4. msi: Prevent call to memset with a null pointer
  5. in get_tablecolumns function.
  6. Fix miscompilation with gcc >= 4.9
  7. See https://bugs.winehq.org/show_bug.cgi?id=36139 for the upstream
  8. bug report. There won't be a Wine 1.6.3 so we need to address this
  9. anyway.
  10. Backported from: deb274226783ab886bdb44876944e156757efe2b
  11. Signed-off-by: André Hentschel <nerv@dawncrow.de>
  12. ---
  13. dlls/msi/table.c | 4 ++--
  14. 1 file changed, 2 insertions(+), 2 deletions(-)
  15. diff --git a/dlls/msi/table.c b/dlls/msi/table.c
  16. index 8012369..9ed9421 100644
  17. --- a/dlls/msi/table.c
  18. +++ b/dlls/msi/table.c
  19. @@ -671,7 +671,7 @@ static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINF
  20. /* Note: _Columns table doesn't have non-persistent data */
  21. /* if maxcount is non-zero, assume it's exactly right for this table */
  22. - memset( colinfo, 0, maxcount * sizeof(*colinfo) );
  23. + if (colinfo) memset( colinfo, 0, maxcount * sizeof(*colinfo) );
  24. count = table->row_count;
  25. for (i = 0; i < count; i++)
  26. {
  27. @@ -684,7 +684,7 @@ static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINF
  28. /* check the column number is in range */
  29. if (col < 1 || col > maxcount)
  30. {
  31. - ERR("column %d out of range\n", col);
  32. + ERR("column %d out of range (maxcount: %d)\n", col, maxcount);
  33. continue;
  34. }
  35. /* check if this column was already set */