Marcus Meissner : rpcrt4: Fixed array_compute_and_size_conformance on strings (Coverity).

Alexandre Julliard julliard at winehq.org
Mon Dec 7 10:26:16 CST 2009


Module: wine
Branch: master
Commit: 4c36f79964519e9160b11cc530ec745907ece6cc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4c36f79964519e9160b11cc530ec745907ece6cc

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Sun Dec  6 23:33:56 2009 +0100

rpcrt4: Fixed array_compute_and_size_conformance on strings (Coverity).

---

 dlls/rpcrt4/ndr_marshall.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index 8db45b8..4511164 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -1778,7 +1778,7 @@ static inline void array_compute_and_size_conformance(
     break;
   case RPC_FC_C_CSTRING:
   case RPC_FC_C_WSTRING:
-    if (pFormat[0] == RPC_FC_C_CSTRING)
+    if (fc == RPC_FC_C_CSTRING)
     {
       TRACE("string=%s\n", debugstr_a((const char *)pMemory));
       pStubMsg->ActualCount = strlen((const char *)pMemory)+1;
@@ -1789,7 +1789,7 @@ static inline void array_compute_and_size_conformance(
       pStubMsg->ActualCount = strlenW((LPCWSTR)pMemory)+1;
     }
 
-    if (fc == RPC_FC_STRING_SIZED)
+    if (pFormat[1] == RPC_FC_STRING_SIZED)
       pFormat = ComputeConformance(pStubMsg, pMemory, pFormat + 2, 0);
     else
       pStubMsg->MaxCount = pStubMsg->ActualCount;




More information about the wine-cvs mailing list