Ignore:
Timestamp:
Feb 21, 2010, 5:32:09 PM (16 years ago)
Author:
rlwalsh
Message:

eliminate VACPP warning & info msgs - see Ticket #1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/crypt32/decode.c

    r21311 r21354  
    3838#include <stdio.h>
    3939#include <stdlib.h>
     40#include <string.h>
     41#include <ctype.h>
    4042
    4143#define NONAMELESSUNION
     
    4648#include "winnls.h"
    4749#include "snmp.h"
    48 #include "wine/debug.h"
    49 #include "wine/exception.h"
     50#include "wine\debug.h"
     51#include "wine\exception.h"
    5052#include "crypt32_private.h"
    5153
     
    224226            *(BYTE **)pvStructInfo = pDecodePara->pfnAlloc(bytesNeeded);
    225227        else
    226             *(BYTE **)pvStructInfo = LocalAlloc(0, bytesNeeded);
     228            *(BYTE **)pvStructInfo = (BYTE*)LocalAlloc(0, bytesNeeded);
    227229        if (!*(BYTE **)pvStructInfo)
    228230            ret = FALSE;
     
    246248        pDecodePara->pfnFree(pv);
    247249    else
    248         LocalFree(pv);
     250        LocalFree((HANDLE)pv);
    249251}
    250252
     
    329331
    330332            if ((ret = CRYPT_GetLengthIndefinite(ptr,
    331              cbEncoded - (ptr - pbEncoded), &itemLen)))
     333             cbEncoded - (ptr - pbEncoded), &itemLen)) != FALSE)
    332334            {
    333335                BYTE itemLenBytes = GET_LEN_BYTES(ptr[1]);
     
    484486        DWORD dataLen;
    485487
    486         if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &dataLen)))
     488        if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    487489        {
    488490            DWORD lenBytes = GET_LEN_BYTES(pbEncoded[1]), cbDecoded;
     
    547549                    *pcbStructInfo = bytesNeeded;
    548550                else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags,
    549                  pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded)))
     551                 pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    550552                {
    551553                    BYTE *nextData;
     
    623625        DWORD dataLen;
    624626
    625         if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &dataLen)))
     627        if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    626628        {
    627629            DWORD bytesNeeded, cItems = 0, decoded;
     
    664666                         */
    665667                        if ((ret = CRYPT_GetLengthIndefinite(ptr,
    666                          cbEncoded - (ptr - pbEncoded), &itemDataLen)))
     668                         cbEncoded - (ptr - pbEncoded), &itemDataLen)) != FALSE)
    667669                        {
    668670                            if (itemDataLen == CMSG_INDEFINITE_LENGTH)
     
    712714                    *pcbStructInfo = bytesNeeded;
    713715                else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags,
    714                  pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded)))
     716                 pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    715717                {
    716718                    DWORD i;
     
    778780    DWORD dataLen;
    779781
    780     if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     782    if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    781783    {
    782784        BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
     
    790792        if (!pvStructInfo)
    791793            *pcbStructInfo = bytesNeeded;
    792         else if ((ret = CRYPT_DecodeCheckSpace(pcbStructInfo, bytesNeeded)))
     794        else if ((ret = CRYPT_DecodeCheckSpace(pcbStructInfo, bytesNeeded)) != FALSE)
    793795        {
    794796            CRYPT_DER_BLOB *blob;
     
    902904    DWORD dataLen;
    903905
    904     if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     906    if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    905907    {
    906908        BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
     
    939941    DWORD dataLen;
    940942
    941     if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     943    if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    942944    {
    943945        BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
     
    10461048                 signedCert->ToBeSigned.cbData, dwFlags, pDecodePara,
    10471049                 pvStructInfo, pcbStructInfo);
    1048                 LocalFree(signedCert);
     1050                LocalFree((HANDLE)signedCert);
    10491051            }
    10501052        }
     
    11861188                 signedCrl->ToBeSigned.cbData, dwFlags, pDecodePara,
    11871189                 pvStructInfo, pcbStructInfo);
    1188                 LocalFree(signedCrl);
     1190                LocalFree((HANDLE)signedCrl);
    11891191            }
    11901192        }
     
    12171219     pvStructInfo, *pcbStructInfo);
    12181220
    1219     if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     1221    if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    12201222    {
    12211223        BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
     
    14341436    CERT_NAME_VALUE *value = (CERT_NAME_VALUE *)pvStructInfo;
    14351437
    1436     if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     1438    if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    14371439    {
    14381440        BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
     
    16211623    CERT_NAME_VALUE *value = (CERT_NAME_VALUE *)pvStructInfo;
    16221624
    1623     if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     1625    if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    16241626    {
    16251627        BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
     
    19521954            done = TRUE;
    19531955        else if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded,
    1954          &dataLen)))
     1956         &dataLen)) != FALSE)
    19551957        {
    19561958            BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
     
    20042006     pvStructInfo, *pcbStructInfo);
    20052007
    2006     if ((ret = CRYPT_FindEncodedLen(pbEncoded, cbEncoded, &encodedLen)))
     2008    if ((ret = CRYPT_FindEncodedLen(pbEncoded, cbEncoded, &encodedLen)) != FALSE)
    20072009    {
    20082010        if (!(dwFlags & CRYPT_DECODE_NOCOPY_FLAG))
     
    22292231        else if ((ret = CRYPT_AsnDecodeSMIMECapabilitiesInternal(pbEncoded,
    22302232         cbEncoded, dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded,
    2231          NULL)))
     2233         NULL)) != FALSE)
    22322234        {
    22332235            if (!pvStructInfo)
    22342236                *pcbStructInfo = bytesNeeded;
    22352237            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    2236              pvStructInfo, pcbStructInfo, bytesNeeded)))
     2238             pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    22372239            {
    22382240                PCRYPT_SMIME_CAPABILITIES capabilities;
     
    22672269    LPSTR *pStr = pvStructInfo;
    22682270
    2269     if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     2271    if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    22702272    {
    22712273        BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
     
    24002402    DWORD dataLen;
    24012403
    2402     if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     2404    if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    24032405    {
    24042406        BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
     
    25692571                *pcbStructInfo = bytesNeeded;
    25702572            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    2571              pvStructInfo, pcbStructInfo, bytesNeeded)))
     2573             pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    25722574            {
    25732575                PCERT_POLICY_QUALIFIER_USER_NOTICE notice;
     
    26402642                *pcbStructInfo = bytesNeeded;
    26412643            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    2642              pvStructInfo, pcbStructInfo, bytesNeeded)))
     2644             pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    26432645            {
    26442646                PCRYPT_ATTRIBUTE attr;
     
    26992701        else if ((ret = CRYPT_AsnDecodePKCSAttributesInternal(pbEncoded,
    27002702         cbEncoded, dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded,
    2701          NULL)))
     2703         NULL)) != FALSE)
    27022704        {
    27032705            if (!pvStructInfo)
    27042706                *pcbStructInfo = bytesNeeded;
    27052707            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    2706              pvStructInfo, pcbStructInfo, bytesNeeded)))
     2708             pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    27072709            {
    27082710                PCRYPT_ATTRIBUTES attrs;
     
    27902792
    27912793        if ((ret = CRYPT_AsnDecodePubKeyInfoInternal(pbEncoded, cbEncoded,
    2792          dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)))
     2794         dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) != FALSE)
    27932795        {
    27942796            if (!pvStructInfo)
    27952797                *pcbStructInfo = bytesNeeded;
    27962798            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    2797              pvStructInfo, pcbStructInfo, bytesNeeded)))
     2799             pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    27982800            {
    27992801                PCERT_PUBLIC_KEY_INFO info;
     
    28832885        return FALSE;
    28842886    }
    2885     if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     2887    if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    28862888    {
    28872889        switch (pbEncoded[0] & ASN_TYPE_MASK)
     
    31683170     * Check the outer length is valid:
    31693171     */
    3170     if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &dataLen)))
     3172    if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    31713173    {
    31723174        BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
     
    31783180            cbEncoded -= 2; /* space for 0 TLV */
    31793181        /* Check the inner length is valid: */
    3180         if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &innerLen)))
     3182        if ((ret = CRYPT_GetLengthIndefinite(pbEncoded, cbEncoded, &innerLen)) != FALSE)
    31813183        {
    31823184            DWORD decodedLen;
     
    33143316
    33153317        if ((ret = CRYPT_AsnDecodeAltNameInternal(pbEncoded, cbEncoded,
    3316          dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)))
     3318         dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) != FALSE)
    33173319        {
    33183320            if (!pvStructInfo)
    33193321                *pcbStructInfo = bytesNeeded;
    33203322            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    3321              pvStructInfo, pcbStructInfo, bytesNeeded)))
     3323             pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    33223324            {
    33233325                CERT_ALT_NAME_INFO *name;
     
    36073609            }
    36083610            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    3609              pvStructInfo, pcbStructInfo, bytesNeeded)))
     3611             pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    36103612            {
    36113613                BLOBHEADER *hdr;
     
    36283630                 decodedKey->modulus.cbData);
    36293631            }
    3630             LocalFree(decodedKey);
     3632            LocalFree((HANDLE)decodedKey);
    36313633        }
    36323634    }
     
    36503652     pvStructInfo, *pcbStructInfo, pcbDecoded);
    36513653
    3652     if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     3654    if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    36533655    {
    36543656        BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
     
    37133715        }
    37143716        else if ((ret = CRYPT_AsnDecodeOctetsInternal(pbEncoded, cbEncoded,
    3715          dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)))
     3717         dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) != FALSE)
    37163718        {
    37173719            if (!pvStructInfo)
    37183720                *pcbStructInfo = bytesNeeded;
    37193721            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    3720              pvStructInfo, pcbStructInfo, bytesNeeded)))
     3722             pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    37213723            {
    37223724                CRYPT_DATA_BLOB *blob;
     
    37513753     pvStructInfo, *pcbStructInfo, pcbDecoded);
    37523754
    3753     if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     3755    if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    37543756    {
    37553757        if (dwFlags & CRYPT_DECODE_NOCOPY_FLAG)
     
    38203822        }
    38213823        else if ((ret = CRYPT_AsnDecodeBitsInternal(pbEncoded, cbEncoded,
    3822          dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)))
     3824         dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) != FALSE)
    38233825        {
    38243826            if (!pvStructInfo)
    38253827                *pcbStructInfo = bytesNeeded;
    38263828            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    3827              pvStructInfo, pcbStructInfo, bytesNeeded)))
     3829             pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    38283830            {
    38293831                CRYPT_BIT_BLOB *blob;
     
    38653867        if (!pvStructInfo)
    38663868            *pcbStructInfo = sizeof(int);
    3867         else if ((ret = CRYPT_DecodeCheckSpace(pcbStructInfo, sizeof(int))))
     3869        else if ((ret = CRYPT_DecodeCheckSpace(pcbStructInfo, sizeof(int))) != FALSE)
    38683870        {
    38693871            int val, i;
     
    39173919                *pcbStructInfo = bytesNeeded;
    39183920            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    3919              pvStructInfo, pcbStructInfo, bytesNeeded)))
     3921             pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    39203922            {
    39213923                if (dwFlags & CRYPT_DECODE_ALLOC_FLAG)
     
    39433945    DWORD bytesNeeded, dataLen;
    39443946
    3945     if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     3947    if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    39463948    {
    39473949        BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
     
    40034005                *pcbStructInfo = bytesNeeded;
    40044006            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    4005              pvStructInfo, pcbStructInfo, bytesNeeded)))
     4007             pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    40064008            {
    40074009                CRYPT_INTEGER_BLOB *blob;
     
    40374039        DWORD bytesNeeded, dataLen;
    40384040
    4039         if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     4041        if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    40404042        {
    40414043            BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]);
     
    40974099
    40984100        if ((ret = CRYPT_AsnDecodeUnsignedIntegerInternal(pbEncoded, cbEncoded,
    4099          dwFlags & ~CRYPT_ENCODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)))
     4101         dwFlags & ~CRYPT_ENCODE_ALLOC_FLAG, NULL, &bytesNeeded, NULL)) != FALSE)
    41004102        {
    41014103            if (!pvStructInfo)
    41024104                *pcbStructInfo = bytesNeeded;
    41034105            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    4104              pvStructInfo, pcbStructInfo, bytesNeeded)))
     4106             pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    41054107            {
    41064108                CRYPT_INTEGER_BLOB *blob;
     
    41714173                }
    41724174                if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    4173                  pvStructInfo, pcbStructInfo, sizeof(unsigned int))))
     4175                 pvStructInfo, pcbStructInfo, sizeof(unsigned int))) != FALSE)
    41744176                {
    41754177                    if (dwFlags & CRYPT_DECODE_ALLOC_FLAG)
     
    43294331                        *pcbStructInfo = sizeof(FILETIME);
    43304332                    else if ((ret = CRYPT_DecodeCheckSpace(pcbStructInfo,
    4331                      sizeof(FILETIME))))
     4333                     sizeof(FILETIME))) != FALSE)
    43324334                        ret = SystemTimeToFileTime(&sysTime,
    43334335                         (FILETIME *)pvStructInfo);
     
    43584360                *pcbStructInfo = bytesNeeded;
    43594361            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags,
    4360              pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded)))
     4362             pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    43614363            {
    43624364                if (dwFlags & CRYPT_DECODE_ALLOC_FLAG)
     
    44374439                        *pcbStructInfo = sizeof(FILETIME);
    44384440                    else if ((ret = CRYPT_DecodeCheckSpace(pcbStructInfo,
    4439                      sizeof(FILETIME))))
     4441                     sizeof(FILETIME))) != FALSE)
    44404442                        ret = SystemTimeToFileTime(&sysTime,
    44414443                         (FILETIME *)pvStructInfo);
     
    44884490                *pcbStructInfo = bytesNeeded;
    44894491            else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    4490              pvStructInfo, pcbStructInfo, bytesNeeded)))
     4492             pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    44914493            {
    44924494                if (dwFlags & CRYPT_DECODE_ALLOC_FLAG)
     
    45194521            DWORD bytesNeeded, dataLen, remainingLen, cValue;
    45204522
    4521             if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     4523            if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    45224524            {
    45234525                BYTE lenBytes;
     
    45554557                        *pcbStructInfo = bytesNeeded;
    45564558                    else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara,
    4557                      pvStructInfo, pcbStructInfo, bytesNeeded)))
     4559                     pvStructInfo, pcbStructInfo, bytesNeeded)) != FALSE)
    45584560                    {
    45594561                        if (dwFlags & CRYPT_DECODE_ALLOC_FLAG)
     
    46224624        DWORD bytesNeeded, dataLen;
    46234625
    4624         if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)))
     4626        if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen)) != FALSE)
    46254627        {
    46264628            struct AsnArrayDescriptor arrayDesc = {
Note: See TracChangeset for help on using the changeset viewer.