msi(1/3): Don't crash if rec is NULL

Juan Lang juan.lang at gmail.com
Fri Sep 14 12:27:54 CDT 2007


> MSI_FormatRecordW is an internal function and we should be crashing if
> rec is NULL.

Are you sure?  This is causing the iTunes installer to crash for a
couple people.  Besides, I don't think the code is written with this
assumption in mind.  In deformat_string_internal:

static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr,
                                     WCHAR** data, DWORD len, MSIRECORD* record,
                                     INT* failcount)
...
    if (ptr==NULL)
    {
        TRACE("Deformatting NULL string\n");
        *data = NULL;
        return 0;
    }

So deformat_string_internal handles NULL correctly.  This patch
changes one of the call sites to avoid dereferencing a NULL pointer
before passing it to a function that deals with a NULL input.

--Juan



More information about the wine-devel mailing list