[PATCH] dpnet: Fixed bad pointer addition (Coverity)
Marcus Meissner
marcus at jet.franken.de
Sat Sep 24 03:42:04 CDT 2011
Hi,
A pointer + integer is always pointer+(sizeof(*pointer)*integer) addition
already, so +1 is better here.
CID 5334.
Ciao, Marcus
---
dlls/dpnet/peer.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/dpnet/peer.c b/dlls/dpnet/peer.c
index 307b306..947531a 100644
--- a/dlls/dpnet/peer.c
+++ b/dlls/dpnet/peer.c
@@ -127,7 +127,7 @@ static HRESULT WINAPI IDirectPlay8PeerImpl_EnumServiceProviders(IDirectPlay8Peer
return DPNERR_BUFFERTOOSMALL;
}
- pSPInfoBuffer->pwszName = (LPWSTR)(pSPInfoBuffer + sizeof(DPN_SERVICE_PROVIDER_INFO));
+ pSPInfoBuffer->pwszName = (LPWSTR)(pSPInfoBuffer + 1);
if(!pguidServiceProvider)
{
--
1.7.3.4
More information about the wine-patches
mailing list