Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
74addd63
Commit
74addd63
authored
Jun 12, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Jun 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Use CRYPT_EncodeEnsureSpace to allocate memory when necessary.
parent
97f2c658
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
17 deletions
+9
-17
encode.c
dlls/crypt32/encode.c
+9
-17
No files found.
dlls/crypt32/encode.c
View file @
74addd63
...
...
@@ -1176,42 +1176,34 @@ static BOOL WINAPI CRYPT_DEREncodeSet(DWORD dwCertEncodingType,
LPCSTR
lpszStructType
,
const
void
*
pvStructInfo
,
DWORD
dwFlags
,
PCRYPT_ENCODE_PARA
pEncodePara
,
BYTE
*
pbEncoded
,
DWORD
*
pcbEncoded
)
{
CRYPT_SET_OF
*
set
=
(
CRYPT_SET_OF
*
)
pvStructInfo
;
const
CRYPT_SET_OF
*
set
=
(
const
CRYPT_SET_OF
*
)
pvStructInfo
;
DWORD
bytesNeeded
=
0
,
lenBytes
,
i
;
BOOL
ret
=
FALSE
;
BOOL
ret
;
for
(
i
=
0
;
i
<
set
->
cValue
;
i
++
)
bytesNeeded
+=
set
->
rgValue
[
i
].
cbData
;
CRYPT_EncodeLen
(
bytesNeeded
,
NULL
,
&
lenBytes
);
bytesNeeded
+=
1
+
lenBytes
;
if
(
pbEncoded
)
{
if
(
*
pcbEncoded
<
bytesNeeded
)
if
(
!
pbEncoded
)
{
*
pcbEncoded
=
bytesNeeded
;
SetLastError
(
ERROR_MORE_DATA
)
;
ret
=
TRUE
;
}
else
else
if
((
ret
=
CRYPT_EncodeEnsureSpace
(
dwFlags
,
pEncodePara
,
pbEncoded
,
pcbEncoded
,
bytesNeeded
)))
{
ret
=
TRUE
;
*
pcbEncoded
=
bytesNee
ded
;
if
(
dwFlags
&
CRYPT_ENCODE_ALLOC_FLAG
)
pbEncoded
=
*
(
BYTE
**
)
pbEnco
ded
;
qsort
(
set
->
rgValue
,
set
->
cValue
,
sizeof
(
CRYPT_DER_BLOB
),
BLOBComp
);
*
pbEncoded
++
=
ASN_CONSTRUCTOR
|
ASN_SETOF
;
CRYPT_EncodeLen
(
bytesNeeded
-
lenBytes
-
1
,
pbEncoded
,
&
lenBytes
);
pbEncoded
+=
lenBytes
;
for
(
i
=
0
;
ret
&&
i
<
set
->
cValue
;
i
++
)
{
memcpy
(
pbEncoded
,
set
->
rgValue
[
i
].
pbData
,
set
->
rgValue
[
i
].
cbData
);
memcpy
(
pbEncoded
,
set
->
rgValue
[
i
].
pbData
,
set
->
rgValue
[
i
].
cbData
);
pbEncoded
+=
set
->
rgValue
[
i
].
cbData
;
}
}
}
else
{
*
pcbEncoded
=
bytesNeeded
;
ret
=
TRUE
;
}
return
ret
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment