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)
...
@@ -719,27 +719,22 @@ static BOOL CRYPT_ConstructBlob(CRYPT_DATA_BLOB *out, const CRYPT_DATA_BLOB *in)
return
ret
;
return
ret
;
}
}
typedef
struct
_BlobArray
static
BOOL
CRYPT_ConstructBlobArray
(
DWORD
*
outCBlobs
,
{
PCRYPT_DATA_BLOB
*
outPBlobs
,
DWORD
cBlobs
,
const
PCRYPT_DATA_BLOB
pBlobs
)
DWORD
cBlobs
;
PCRYPT_DATA_BLOB
blobs
;
}
BlobArray
;
static
BOOL
CRYPT_ConstructBlobArray
(
BlobArray
*
out
,
const
BlobArray
*
in
)
{
{
BOOL
ret
=
TRUE
;
BOOL
ret
=
TRUE
;
out
->
cBlobs
=
in
->
cBlobs
;
*
outCBlobs
=
cBlobs
;
if
(
out
->
cBlobs
)
if
(
cBlobs
)
{
{
out
->
blobs
=
CryptMemAlloc
(
out
->
cBlobs
*
sizeof
(
CRYPT_DATA_BLOB
));
*
outPBlobs
=
CryptMemAlloc
(
cBlobs
*
sizeof
(
CRYPT_DATA_BLOB
));
if
(
out
->
b
lobs
)
if
(
*
outPB
lobs
)
{
{
DWORD
i
;
DWORD
i
;
memset
(
out
->
blobs
,
0
,
out
->
cBlobs
*
sizeof
(
CRYPT_DATA_BLOB
));
memset
(
*
outPBlobs
,
0
,
cBlobs
*
sizeof
(
CRYPT_DATA_BLOB
));
for
(
i
=
0
;
ret
&&
i
<
out
->
cBlobs
;
i
++
)
for
(
i
=
0
;
ret
&&
i
<
cBlobs
;
i
++
)
ret
=
CRYPT_ConstructBlob
(
&
out
->
blobs
[
i
],
&
in
->
b
lobs
[
i
]);
ret
=
CRYPT_ConstructBlob
(
&
(
*
outPBlobs
)[
i
],
&
pB
lobs
[
i
]);
}
}
else
else
ret
=
FALSE
;
ret
=
FALSE
;
...
@@ -747,6 +742,12 @@ static BOOL CRYPT_ConstructBlobArray(BlobArray *out, const BlobArray *in)
...
@@ -747,6 +742,12 @@ static BOOL CRYPT_ConstructBlobArray(BlobArray *out, const BlobArray *in)
return
ret
;
return
ret
;
}
}
typedef
struct
_BlobArray
{
DWORD
cBlobs
;
PCRYPT_DATA_BLOB
blobs
;
}
BlobArray
;
static
void
CRYPT_FreeBlobArray
(
BlobArray
*
array
)
static
void
CRYPT_FreeBlobArray
(
BlobArray
*
array
)
{
{
DWORD
i
;
DWORD
i
;
...
@@ -765,8 +766,8 @@ static BOOL CRYPT_ConstructAttribute(CRYPT_ATTRIBUTE *out,
...
@@ -765,8 +766,8 @@ static BOOL CRYPT_ConstructAttribute(CRYPT_ATTRIBUTE *out,
if
(
out
->
pszObjId
)
if
(
out
->
pszObjId
)
{
{
strcpy
(
out
->
pszObjId
,
in
->
pszObjId
);
strcpy
(
out
->
pszObjId
,
in
->
pszObjId
);
ret
=
CRYPT_ConstructBlobArray
(
(
BlobArray
*
)
&
out
->
c
Value
,
ret
=
CRYPT_ConstructBlobArray
(
&
out
->
cValue
,
&
out
->
rg
Value
,
(
const
BlobArray
*
)
&
in
->
c
Value
);
in
->
cValue
,
in
->
rg
Value
);
}
}
else
else
ret
=
FALSE
;
ret
=
FALSE
;
...
@@ -1435,13 +1436,13 @@ static HCRYPTMSG CSignedEncodeMsg_Open(DWORD dwFlags,
...
@@ -1435,13 +1436,13 @@ static HCRYPTMSG CSignedEncodeMsg_Open(DWORD dwFlags,
}
}
}
}
if
(
ret
)
if
(
ret
)
ret
=
CRYPT_ConstructBlobArray
(
ret
=
CRYPT_ConstructBlobArray
(
&
msg
->
msg_data
.
info
->
cCertEncoded
,
(
BlobArray
*
)
&
msg
->
msg_data
.
info
->
cCertEncoded
,
&
msg
->
msg_data
.
info
->
rgCertEncoded
,
info
->
cCertEncoded
,
(
const
BlobArray
*
)
&
info
->
c
CertEncoded
);
info
->
rg
CertEncoded
);
if
(
ret
)
if
(
ret
)
ret
=
CRYPT_ConstructBlobArray
(
ret
=
CRYPT_ConstructBlobArray
(
&
msg
->
msg_data
.
info
->
cCrlEncoded
,
(
BlobArray
*
)
&
msg
->
msg_data
.
info
->
cCrlEncoded
,
&
msg
->
msg_data
.
info
->
rgCrlEncoded
,
info
->
cCrlEncoded
,
(
const
BlobArray
*
)
&
info
->
c
CrlEncoded
);
info
->
rg
CrlEncoded
);
if
(
!
ret
)
if
(
!
ret
)
{
{
CSignedEncodeMsg_Close
(
msg
);
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