Commit e577e4b3 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

libwine: Fix a potential write through a null pointer. (Clang).

parent 9a799304
......@@ -985,10 +985,13 @@ void *wine_dlopen( const char *filename, int flag, char *error, size_t errorsize
{
if (pread( fd, magic, 2, 0 ) == 2 && magic[0] == 'M' && magic[1] == 'Z')
{
static const char msg[] = "MZ format";
size_t len = min( errorsize, sizeof(msg) );
memcpy( error, msg, len );
error[len - 1] = 0;
if (error && errorsize)
{
static const char msg[] = "MZ format";
size_t len = min( errorsize, sizeof(msg) );
memcpy( error, msg, len );
error[len - 1] = 0;
}
close( fd );
return NULL;
}
......
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