Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Ensure xbt_new0 is called with a size > 0.
[simgrid.git] / src / smpi / bindings / smpi_pmpi_request.cpp
index 7160946..88a4c98 100644 (file)
@@ -460,6 +460,7 @@ int PMPI_Sendrecv_replace(void* buf, int count, MPI_Datatype datatype, int dst,
   CHECK_TYPE(3, datatype)
 
   int size = datatype->get_extent() * count;
+  xbt_assert(size > 0);
   void* recvbuf = xbt_new0(char, size);
   retval = MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf, count, datatype, src, recvtag, comm, status);
   if(retval==MPI_SUCCESS){