Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Unified Diff: util/test/mac/mach_multiprocess.cc

Issue 1001943002: handler/mac: Log a warning when an exception message has a suspicious (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: util/test/mac/mach_multiprocess.cc
diff --git a/util/test/mac/mach_multiprocess.cc b/util/test/mac/mach_multiprocess.cc
index 9660ee0e4aa4d45aaa4bb389d160719a6216a69b..f968cf37a9c8cdd183ba015699f40802f665af43 100644
--- a/util/test/mac/mach_multiprocess.cc
+++ b/util/test/mac/mach_multiprocess.cc
@@ -28,6 +28,7 @@
#include "gtest/gtest.h"
#include "util/file/file_io.h"
#include "util/mach/mach_extensions.h"
+#include "util/mach/mach_message.h"
#include "util/misc/scoped_forbid_return.h"
#include "util/test/errors.h"
#include "util/test/mac/mach_errors.h"
@@ -40,7 +41,10 @@ struct SendHelloMessage : public mach_msg_base_t {
};
struct ReceiveHelloMessage : public SendHelloMessage {
- mach_msg_audit_trailer_t audit_trailer;
+ union {
+ mach_msg_trailer_t trailer;
+ mach_msg_audit_trailer_t audit_trailer;
+ };
};
} // namespace
@@ -186,6 +190,8 @@ void MachMultiprocess::MultiprocessParent() {
EXPECT_EQ(getgid(), audit_rgid);
ASSERT_EQ(ChildPID(), audit_pid);
+ ASSERT_EQ(ChildPID(), AuditPIDFromMachMessageTrailer(&message.trailer));
+
auditinfo_addr_t audit_info;
int rv = getaudit_addr(&audit_info, sizeof(audit_info));
ASSERT_EQ(0, rv) << ErrnoMessage("getaudit_addr");

Powered by Google App Engine
This is Rietveld 408576698