Index: mojo/shell/in_process_dynamic_service_runner.cc |
diff --git a/mojo/shell/in_process_dynamic_service_runner.cc b/mojo/shell/in_process_dynamic_service_runner.cc |
index 9030d59927604cc4c33d5795f78e63f661217603..660418083c31cf94f7737bd074893dea4103d874 100644 |
--- a/mojo/shell/in_process_dynamic_service_runner.cc |
+++ b/mojo/shell/in_process_dynamic_service_runner.cc |
@@ -11,6 +11,7 @@ |
#include "base/logging.h" |
#include "base/message_loop/message_loop_proxy.h" |
#include "base/scoped_native_library.h" |
+#include "mojo/public/platform/native/system_thunks.h" |
namespace mojo { |
namespace shell { |
@@ -63,6 +64,20 @@ void InProcessDynamicServiceRunner::Run() { |
break; |
} |
+ MojoSetSystemThunksFn mojo_set_system_thunks_fn = |
+ reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( |
+ "MojoSetSystemThunks")); |
+ if (mojo_set_system_thunks_fn) { |
+ MojoSystemThunks system_thunks = MojoMakeSystemThunks(); |
+ size_t expected_size = mojo_set_system_thunks_fn(&system_thunks); |
+ if (expected_size > sizeof(MojoSystemThunks)) { |
+ LOG(ERROR) |
+ << "Invalid DSO. Expected MojoSystemThunks size: " |
+ << expected_size; |
+ break; |
+ } |
+ } |
+ |
typedef MojoResult (*MojoMainFunction)(MojoHandle); |
MojoMainFunction main_function = reinterpret_cast<MojoMainFunction>( |
app_library.GetFunctionPointer("MojoMain")); |