Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / native_client / src / trusted / service_runtime / linux / nacl_signal_mips.c
index 6082b0a..cd28c71 100644 (file)
@@ -1,10 +1,11 @@
 /*
  * Copyright 2012 The Native Client Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can
- * be found in the LICENSE file.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
  */
 
 #include <signal.h>
+#include <string.h>
 #include <sys/ucontext.h>
 
 #include "native_client/src/trusted/service_runtime/nacl_signal.h"
@@ -21,6 +22,8 @@ void NaClSignalContextFromHandler(struct NaClSignalContext *sig_ctx,
   ucontext_t *uctx = (ucontext_t *) raw_ctx;
   mcontext_t *mctx = &uctx->uc_mcontext;
 
+  memset(sig_ctx, 0, sizeof(*sig_ctx));
+
   sig_ctx->prog_ctr = mctx->pc;
 
   sig_ctx->zero = mctx->gregs[0];