From 6670f3d9612b3c61e864ef65af58c26c50dd407b Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Mon, 26 Jul 2010 16:06:51 -0700 Subject: [PATCH] nd/adapter: move up check against query length Check that the length of pInfo is large enough before dereferencing it. Signed-off-by: Sean Hefty --- trunk/ulp/netdirect2/user/nd_adapter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trunk/ulp/netdirect2/user/nd_adapter.cpp b/trunk/ulp/netdirect2/user/nd_adapter.cpp index 475c1e61..9b99c1ef 100644 --- a/trunk/ulp/netdirect2/user/nd_adapter.cpp +++ b/trunk/ulp/netdirect2/user/nd_adapter.cpp @@ -116,15 +116,15 @@ Query(ND_ADAPTER_INFO* pInfo, SIZE_T* pcbInfo) WV_DEVICE_ATTRIBUTES attr; HRESULT hr; - if (pInfo != NULL && pInfo->InfoVersion != 1) { - return ND_NOT_SUPPORTED; - } - if (*pcbInfo < sizeof(ND_ADAPTER_INFO)) { hr = ND_BUFFER_OVERFLOW; goto out; } + if (pInfo != NULL && pInfo->InfoVersion != 1) { + return ND_NOT_SUPPORTED; + } + hr = m_pWvDevice->Query(&attr); if (FAILED(hr)) { goto out; -- 2.46.0