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

Handle NULL buffer in GetObject.

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