mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
don't pass NULL as the last two parameters to ReadFile. This fixes a crash while installing OOo 2.0. Patch also submitted to winehq.
svn path=/trunk/; revision=18834
This commit is contained in:
parent
b1f73ba822
commit
98191672ef
1 changed files with 6 additions and 5 deletions
|
@ -3676,8 +3676,9 @@ static LPWSTR load_ttfname_from(LPCWSTR filename)
|
||||||
TT_TABLE_DIRECTORY tblDir;
|
TT_TABLE_DIRECTORY tblDir;
|
||||||
BOOL bFound = FALSE;
|
BOOL bFound = FALSE;
|
||||||
TT_OFFSET_TABLE ttOffsetTable;
|
TT_OFFSET_TABLE ttOffsetTable;
|
||||||
|
DWORD dwRead;
|
||||||
|
|
||||||
ReadFile(handle,&ttOffsetTable, sizeof(TT_OFFSET_TABLE),NULL,NULL);
|
ReadFile(handle,&ttOffsetTable, sizeof(TT_OFFSET_TABLE),&dwRead,NULL);
|
||||||
ttOffsetTable.uNumOfTables = SWAPWORD(ttOffsetTable.uNumOfTables);
|
ttOffsetTable.uNumOfTables = SWAPWORD(ttOffsetTable.uNumOfTables);
|
||||||
ttOffsetTable.uMajorVersion = SWAPWORD(ttOffsetTable.uMajorVersion);
|
ttOffsetTable.uMajorVersion = SWAPWORD(ttOffsetTable.uMajorVersion);
|
||||||
ttOffsetTable.uMinorVersion = SWAPWORD(ttOffsetTable.uMinorVersion);
|
ttOffsetTable.uMinorVersion = SWAPWORD(ttOffsetTable.uMinorVersion);
|
||||||
|
@ -3688,7 +3689,7 @@ static LPWSTR load_ttfname_from(LPCWSTR filename)
|
||||||
|
|
||||||
for (i=0; i< ttOffsetTable.uNumOfTables; i++)
|
for (i=0; i< ttOffsetTable.uNumOfTables; i++)
|
||||||
{
|
{
|
||||||
ReadFile(handle,&tblDir, sizeof(TT_TABLE_DIRECTORY),NULL,NULL);
|
ReadFile(handle,&tblDir, sizeof(TT_TABLE_DIRECTORY),&dwRead,NULL);
|
||||||
if (strncmp(tblDir.szTag,"name",4)==0)
|
if (strncmp(tblDir.szTag,"name",4)==0)
|
||||||
{
|
{
|
||||||
bFound = TRUE;
|
bFound = TRUE;
|
||||||
|
@ -3705,14 +3706,14 @@ static LPWSTR load_ttfname_from(LPCWSTR filename)
|
||||||
|
|
||||||
SetFilePointer(handle, tblDir.uOffset, NULL, FILE_BEGIN);
|
SetFilePointer(handle, tblDir.uOffset, NULL, FILE_BEGIN);
|
||||||
ReadFile(handle,&ttNTHeader, sizeof(TT_NAME_TABLE_HEADER),
|
ReadFile(handle,&ttNTHeader, sizeof(TT_NAME_TABLE_HEADER),
|
||||||
NULL,NULL);
|
&dwRead,NULL);
|
||||||
|
|
||||||
ttNTHeader.uNRCount = SWAPWORD(ttNTHeader.uNRCount);
|
ttNTHeader.uNRCount = SWAPWORD(ttNTHeader.uNRCount);
|
||||||
ttNTHeader.uStorageOffset = SWAPWORD(ttNTHeader.uStorageOffset);
|
ttNTHeader.uStorageOffset = SWAPWORD(ttNTHeader.uStorageOffset);
|
||||||
bFound = FALSE;
|
bFound = FALSE;
|
||||||
for(i=0; i<ttNTHeader.uNRCount; i++)
|
for(i=0; i<ttNTHeader.uNRCount; i++)
|
||||||
{
|
{
|
||||||
ReadFile(handle,&ttRecord, sizeof(TT_NAME_RECORD),NULL,NULL);
|
ReadFile(handle,&ttRecord, sizeof(TT_NAME_RECORD),&dwRead,NULL);
|
||||||
ttRecord.uNameID = SWAPWORD(ttRecord.uNameID);
|
ttRecord.uNameID = SWAPWORD(ttRecord.uNameID);
|
||||||
/* 4 is the Full Font Name */
|
/* 4 is the Full Font Name */
|
||||||
if(ttRecord.uNameID == 4)
|
if(ttRecord.uNameID == 4)
|
||||||
|
@ -3730,7 +3731,7 @@ static LPWSTR load_ttfname_from(LPCWSTR filename)
|
||||||
NULL, FILE_BEGIN);
|
NULL, FILE_BEGIN);
|
||||||
buf = msi_alloc( ttRecord.uStringLength + 1 + strlen(tt) );
|
buf = msi_alloc( ttRecord.uStringLength + 1 + strlen(tt) );
|
||||||
memset(buf, 0, ttRecord.uStringLength + 1 + strlen(tt));
|
memset(buf, 0, ttRecord.uStringLength + 1 + strlen(tt));
|
||||||
ReadFile(handle, buf, ttRecord.uStringLength, NULL, NULL);
|
ReadFile(handle, buf, ttRecord.uStringLength, &dwRead, NULL);
|
||||||
if (strlen(buf) > 0)
|
if (strlen(buf) > 0)
|
||||||
{
|
{
|
||||||
strcat(buf,tt);
|
strcat(buf,tt);
|
||||||
|
|
Loading…
Reference in a new issue