Commit 2fbe5bea authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

crypt32/tests: Prevent a crash on Win9x (test_data_msg).

parent 3c6fb6bb
......@@ -413,18 +413,22 @@ static void test_data_msg_update(void)
ok(ret, "CryptMsgUpdate failed: %x\n", GetLastError());
CryptMsgClose(msg);
/* Calling update after opening with an empty stream info (with a bogus
* output function) yields an error:
*/
msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_DATA, NULL, NULL,
&streamInfo);
SetLastError(0xdeadbeef);
ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), FALSE);
ok(!ret && (GetLastError() == STATUS_ACCESS_VIOLATION ||
GetLastError() == STATUS_ILLEGAL_INSTRUCTION /* WinME */),
"Expected STATUS_ACCESS_VIOLATION or STATUS_ILLEGAL_INSTRUCTION, got %x\n",
GetLastError());
CryptMsgClose(msg);
if (have_nt)
{
/* Calling update after opening with an empty stream info (with a bogus
* output function) yields an error:
*/
/* Crashes on some Win9x */
msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_DATA, NULL, NULL,
&streamInfo);
SetLastError(0xdeadbeef);
ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), FALSE);
ok(!ret && (GetLastError() == STATUS_ACCESS_VIOLATION ||
GetLastError() == STATUS_ILLEGAL_INSTRUCTION /* WinME */),
"Expected STATUS_ACCESS_VIOLATION or STATUS_ILLEGAL_INSTRUCTION, got %x\n",
GetLastError());
CryptMsgClose(msg);
}
/* Calling update with a valid output function succeeds, even if the data
* exceeds the size specified in the stream info.
*/
......
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