Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
wine
wine-winehq
Commits
3000bc20
Commit
3000bc20
authored
Oct 15, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Oct 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Explicitly pass pointers to blob arrays rather than relying on an…
crypt32: Explicitly pass pointers to blob arrays rather than relying on an invalid alignment assumption.
parent
5f317d70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
22 deletions
+23
-22
msg.c
dlls/crypt32/msg.c
+23
-22
No files found.
dlls/crypt32/msg.c
View file @
3000bc20
...
...
@@ -719,27 +719,22 @@ static BOOL CRYPT_ConstructBlob(CRYPT_DATA_BLOB *out, const CRYPT_DATA_BLOB *in)
return
ret
;
}
typedef
struct
_BlobArray
{
DWORD
cBlobs
;
PCRYPT_DATA_BLOB
blobs
;
}
BlobArray
;
static
BOOL
CRYPT_ConstructBlobArray
(
BlobArray
*
out
,
const
BlobArray
*
in
)
static
BOOL
CRYPT_ConstructBlobArray
(
DWORD
*
outCBlobs
,
PCRYPT_DATA_BLOB
*
outPBlobs
,
DWORD
cBlobs
,
const
PCRYPT_DATA_BLOB
pBlobs
)
{
BOOL
ret
=
TRUE
;
out
->
cBlobs
=
in
->
cBlobs
;
if
(
out
->
cBlobs
)
*
outCBlobs
=
cBlobs
;
if
(
cBlobs
)
{
out
->
blobs
=
CryptMemAlloc
(
out
->
cBlobs
*
sizeof
(
CRYPT_DATA_BLOB
));
if
(
out
->
b
lobs
)
*
outPBlobs
=
CryptMemAlloc
(
cBlobs
*
sizeof
(
CRYPT_DATA_BLOB
));
if
(
*
outPB
lobs
)
{
DWORD
i
;
memset
(
out
->
blobs
,
0
,
out
->
cBlobs
*
sizeof
(
CRYPT_DATA_BLOB
));
for
(
i
=
0
;
ret
&&
i
<
out
->
cBlobs
;
i
++
)
ret
=
CRYPT_ConstructBlob
(
&
out
->
blobs
[
i
],
&
in
->
b
lobs
[
i
]);
memset
(
*
outPBlobs
,
0
,
cBlobs
*
sizeof
(
CRYPT_DATA_BLOB
));
for
(
i
=
0
;
ret
&&
i
<
cBlobs
;
i
++
)
ret
=
CRYPT_ConstructBlob
(
&
(
*
outPBlobs
)[
i
],
&
pB
lobs
[
i
]);
}
else
ret
=
FALSE
;
...
...
@@ -747,6 +742,12 @@ static BOOL CRYPT_ConstructBlobArray(BlobArray *out, const BlobArray *in)
return
ret
;
}
typedef
struct
_BlobArray
{
DWORD
cBlobs
;
PCRYPT_DATA_BLOB
blobs
;
}
BlobArray
;
static
void
CRYPT_FreeBlobArray
(
BlobArray
*
array
)
{
DWORD
i
;
...
...
@@ -765,8 +766,8 @@ static BOOL CRYPT_ConstructAttribute(CRYPT_ATTRIBUTE *out,
if
(
out
->
pszObjId
)
{
strcpy
(
out
->
pszObjId
,
in
->
pszObjId
);
ret
=
CRYPT_ConstructBlobArray
(
(
BlobArray
*
)
&
out
->
c
Value
,
(
const
BlobArray
*
)
&
in
->
c
Value
);
ret
=
CRYPT_ConstructBlobArray
(
&
out
->
cValue
,
&
out
->
rg
Value
,
in
->
cValue
,
in
->
rg
Value
);
}
else
ret
=
FALSE
;
...
...
@@ -1435,13 +1436,13 @@ static HCRYPTMSG CSignedEncodeMsg_Open(DWORD dwFlags,
}
}
if
(
ret
)
ret
=
CRYPT_ConstructBlobArray
(
(
BlobArray
*
)
&
msg
->
msg_data
.
info
->
cCertEncoded
,
(
const
BlobArray
*
)
&
info
->
c
CertEncoded
);
ret
=
CRYPT_ConstructBlobArray
(
&
msg
->
msg_data
.
info
->
cCertEncoded
,
&
msg
->
msg_data
.
info
->
rgCertEncoded
,
info
->
cCertEncoded
,
info
->
rg
CertEncoded
);
if
(
ret
)
ret
=
CRYPT_ConstructBlobArray
(
(
BlobArray
*
)
&
msg
->
msg_data
.
info
->
cCrlEncoded
,
(
const
BlobArray
*
)
&
info
->
c
CrlEncoded
);
ret
=
CRYPT_ConstructBlobArray
(
&
msg
->
msg_data
.
info
->
cCrlEncoded
,
&
msg
->
msg_data
.
info
->
rgCrlEncoded
,
info
->
cCrlEncoded
,
info
->
rg
CrlEncoded
);
if
(
!
ret
)
{
CSignedEncodeMsg_Close
(
msg
);
...
...
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