From baae28171e3955a7fc4d7dc0caca1dbdd91029d0 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Sun, 22 Dec 2019 18:10:37 +0100 Subject: [PATCH] Ensure xbt_new0 is called with a size > 0. --- src/smpi/bindings/smpi_pmpi_request.cpp | 1 + 1 file changed, 1 insertion(+) 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){ -- 2.20.1