Commit e9280a1e authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Handle NULL buffer in GetObject.

parent 7018230a
...@@ -672,7 +672,8 @@ static INT FONT_GetObjectA( HGDIOBJ handle, void *obj, INT count, LPVOID buffer ...@@ -672,7 +672,8 @@ static INT FONT_GetObjectA( HGDIOBJ handle, void *obj, INT count, LPVOID buffer
FONT_LogFontWToA( &font->logfont, &lfA ); FONT_LogFontWToA( &font->logfont, &lfA );
if (count > sizeof(lfA)) count = sizeof(lfA); if (count > sizeof(lfA)) count = sizeof(lfA);
memcpy( buffer, &lfA, count ); if(buffer)
memcpy( buffer, &lfA, count );
return count; return count;
} }
...@@ -683,7 +684,8 @@ static INT FONT_GetObjectW( HGDIOBJ handle, void *obj, INT count, LPVOID buffer ...@@ -683,7 +684,8 @@ static INT FONT_GetObjectW( HGDIOBJ handle, void *obj, INT count, LPVOID buffer
{ {
FONTOBJ *font = obj; FONTOBJ *font = obj;
if (count > sizeof(LOGFONTW)) count = sizeof(LOGFONTW); if (count > sizeof(LOGFONTW)) count = sizeof(LOGFONTW);
memcpy( buffer, &font->logfont, count ); if(buffer)
memcpy( buffer, &font->logfont, count );
return count; return count;
} }
......
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