Commit dc98a727 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Don't return from a try block.

parent 5b37fe45
...@@ -945,32 +945,37 @@ static BOOL WINAPI CRYPT_AsnEncodeNameValue(DWORD dwCertEncodingType, ...@@ -945,32 +945,37 @@ static BOOL WINAPI CRYPT_AsnEncodeNameValue(DWORD dwCertEncodingType,
case CERT_RDN_ANY_TYPE: case CERT_RDN_ANY_TYPE:
/* explicitly disallowed */ /* explicitly disallowed */
SetLastError(E_INVALIDARG); SetLastError(E_INVALIDARG);
return FALSE; ret = FALSE;
break;
default: default:
FIXME("String type %ld unimplemented\n", value->dwValueType); FIXME("String type %ld unimplemented\n", value->dwValueType);
return FALSE; ret = FALSE;
} }
CRYPT_EncodeLen(encodedLen, NULL, &lenBytes); if (ret)
bytesNeeded = 1 + lenBytes + encodedLen;
if (!pbEncoded)
*pcbEncoded = bytesNeeded;
else
{ {
if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, pbEncoded, CRYPT_EncodeLen(encodedLen, NULL, &lenBytes);
pcbEncoded, bytesNeeded))) bytesNeeded = 1 + lenBytes + encodedLen;
if (!pbEncoded)
*pcbEncoded = bytesNeeded;
else
{ {
if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara,
pbEncoded = *(BYTE **)pbEncoded; pbEncoded, pcbEncoded, bytesNeeded)))
*pbEncoded++ = tag;
CRYPT_EncodeLen(encodedLen, pbEncoded, &lenBytes);
pbEncoded += lenBytes;
switch (value->dwValueType)
{ {
case CERT_RDN_NUMERIC_STRING: if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG)
case CERT_RDN_PRINTABLE_STRING: pbEncoded = *(BYTE **)pbEncoded;
case CERT_RDN_T61_STRING: *pbEncoded++ = tag;
case CERT_RDN_IA5_STRING: CRYPT_EncodeLen(encodedLen, pbEncoded, &lenBytes);
memcpy(pbEncoded, value->Value.pbData, value->Value.cbData); pbEncoded += lenBytes;
switch (value->dwValueType)
{
case CERT_RDN_NUMERIC_STRING:
case CERT_RDN_PRINTABLE_STRING:
case CERT_RDN_T61_STRING:
case CERT_RDN_IA5_STRING:
memcpy(pbEncoded, value->Value.pbData,
value->Value.cbData);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment