From: Arnaud Giersch Date: Sun, 22 Dec 2019 17:10:37 +0000 (+0100) Subject: Ensure xbt_new0 is called with a size > 0. X-Git-Tag: v3.25~241 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/baae28171e3955a7fc4d7dc0caca1dbdd91029d0 Ensure xbt_new0 is called with a size > 0. --- diff --git a/src/smpi/bindings/smpi_pmpi_request.cpp b/src/smpi/bindings/smpi_pmpi_request.cpp index 71609468c0..88a4c98267 100644 --- a/src/smpi/bindings/smpi_pmpi_request.cpp +++ b/src/smpi/bindings/smpi_pmpi_request.cpp @@ -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){