Explorar o código

Set MsgBuffers to 0 when newly allocated

Ian Goldberg %!s(int64=2) %!d(string=hai) anos
pai
achega
2434412f0e
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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;
     }