]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
AsyncMessenger: reset newly allocated file_events 3255/head
authorKefu Chai <tchaikov@gmail.com>
Fri, 26 Dec 2014 08:28:22 +0000 (16:28 +0800)
committerKefu Chai <tchaikov@gmail.com>
Fri, 26 Dec 2014 08:28:26 +0000 (16:28 +0800)
* otherwise there is chance that Event could take them as already
  initialized ones even they are filled with random bits from heap.

src/msg/async/Event.cc

index 75676267b6fc9881a08b9b9b99090c0366f63689..2aea4ba0303f33b44399c2e97af1e10b12a2da59 100644 (file)
@@ -120,6 +120,7 @@ int EventCenter::create_file_event(int fd, int mask, EventCallbackRef ctxt)
       lderr(cct) << __func__ << " failed to realloc file_events" << cpp_strerror(errno) << dendl;
       return -errno;
     }
+    memset(file_events+sizeof(FileEvent)*nevent, 0, sizeof(FileEvent)*(new_size-nevent));
     file_events = new_events;
     nevent = new_size;
   }