Procházet zdrojové kódy

Set MsgBuffers to 0 when newly allocated

Ian Goldberg před 1 rokem
rodič
revize
2434412f0e
1 změnil soubory, kde provedl 1 přidání a 0 odebrání
  1. 1 0
      Enclave/route.cpp

+ 1 - 0
Enclave/route.cpp

@@ -38,6 +38,7 @@ struct MsgBuffer {
         inserted = 0;
         // This may throw bad_alloc, but we'll catch it higher up
         buf = new uint8_t[size_t(msgs) * g_teems_config.msg_size];
+        memset(buf, 0, size_t(msgs) * g_teems_config.msg_size);
         bufsize = msgs;
         nodes_received = 0;
     }