diff --git a/reactos/dll/win32/dnsapi/dnsapi/query.c b/reactos/dll/win32/dnsapi/dnsapi/query.c index 5dbbadf757b..fc7f9337887 100644 --- a/reactos/dll/win32/dnsapi/dnsapi/query.c +++ b/reactos/dll/win32/dnsapi/dnsapi/query.c @@ -59,6 +59,9 @@ DnsQuery_A(LPCSTR Name, LPSTR CurrentName; unsigned i, CNameLoop; + if (Name == NULL) + return ERROR_INVALID_PARAMETER; + *QueryResultSet = 0; switch(Type) @@ -200,6 +203,9 @@ DnsQuery_W(LPCWSTR Name, PDNS_RECORD QueryResultWide; PDNS_RECORD ConvertedRecord = 0, LastRecord = 0; + if (Name == NULL) + return ERROR_INVALID_PARAMETER; + Buffer = DnsWToC(Name); Status = DnsQuery_A(Buffer, Type, Options, Servers, &QueryResultWide, Reserved);