| Index: src/trusted/service_runtime/sel_ldr.c
|
| diff --git a/src/trusted/service_runtime/sel_ldr.c b/src/trusted/service_runtime/sel_ldr.c
|
| index 662138c4182d2a99dd0997608d99fc2f1e824295..01f6c48c52a89be1531424072cf3457dc281579d 100644
|
| --- a/src/trusted/service_runtime/sel_ldr.c
|
| +++ b/src/trusted/service_runtime/sel_ldr.c
|
| @@ -15,6 +15,7 @@
|
| #include "native_client/src/include/nacl_macros.h"
|
|
|
| #include "native_client/src/public/desc_metadata_types.h"
|
| +#include "native_client/src/public/nacl_app.h"
|
| #include "native_client/src/public/secure_service.h"
|
|
|
| #include "native_client/src/shared/gio/gio.h"
|
| @@ -78,6 +79,9 @@ int NaClAppWithSyscallTableCtor(struct NaClApp *nap,
|
| struct NaClSyscallTableEntry *table) {
|
| struct NaClDescEffectorLdr *effp;
|
|
|
| + /* Zero-initialize in case we miss any fields below. */
|
| + memset(nap, 0, sizeof(*nap));
|
| +
|
| /* The validation cache will be injected later, if it exists. */
|
| nap->validation_cache = NULL;
|
|
|
| @@ -333,6 +337,15 @@ int NaClAppCtor(struct NaClApp *nap) {
|
| return NaClAppWithSyscallTableCtor(nap, nacl_syscall);
|
| }
|
|
|
| +struct NaClApp *NaClAppCreate(void) {
|
| + struct NaClApp *nap = malloc(sizeof(struct NaClApp));
|
| + if (nap == NULL)
|
| + NaClLog(LOG_FATAL, "Failed to allocate NaClApp\n");
|
| + if (!NaClAppCtor(nap))
|
| + NaClLog(LOG_FATAL, "NaClAppCtor() failed\n");
|
| + return nap;
|
| +}
|
| +
|
| /*
|
| * unaligned little-endian load. precondition: nbytes should never be
|
| * more than 8.
|
|
|