[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-cvs
Subject:    Marcus Meissner : crypt32: NULL ptr could leak into function
From:       Alexandre Julliard <julliard () winehq ! org>
Date:       2010-12-31 17:01:07
Message-ID: E1PYiLj-00057y-4j () wine ! codeweavers ! com
[Download RAW message or body]

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

Author: Marcus Meissner <marcus@jet.franken.de>
Date:   Fri Dec 31 12:00:22 2010 +0100

crypt32: NULL ptr could leak into function (Coverity).

---

 dlls/crypt32/encode.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c
index 5d6affe..f10c92e 100644
--- a/dlls/crypt32/encode.c
+++ b/dlls/crypt32/encode.c
@@ -4628,8 +4628,13 @@ BOOL WINAPI CryptEncodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType,
     }
 
     SetLastError(NOERROR);
-    if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG && pvEncoded)
+    if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) {
+        if (!pvEncoded) {
+            SetLastError(ERROR_INVALID_PARAMETER);
+            return FALSE;
+        }
         *(BYTE **)pvEncoded = NULL;
+    }
     encodeFunc = CRYPT_GetBuiltinEncoder(dwCertEncodingType, lpszStructType);
     if (!encodeFunc)
     {



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic