From: Augustin Degomme Date: Sat, 6 Apr 2019 12:54:02 +0000 (+0200) Subject: please herr sonar X-Git-Tag: v3.22.2~163^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6cf57242a375fb0186c9eefcf46fcff848d54b19?hp=a4129e0f81724054c885e3242f05996ffa9d501b please herr sonar --- diff --git a/src/smpi/bindings/smpi_pmpi_coll.cpp b/src/smpi/bindings/smpi_pmpi_coll.cpp index c4f8183dca..2eb62c2c09 100644 --- a/src/smpi/bindings/smpi_pmpi_coll.cpp +++ b/src/smpi/bindings/smpi_pmpi_coll.cpp @@ -760,7 +760,9 @@ int PMPI_Ialltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* re MPI_Datatype sendtmptype = sendtype; if (sendbuf == MPI_IN_PLACE) { sendtmpbuf = static_cast(xbt_malloc(recvcount * comm->size() * recvtype->size())); - memcpy(sendtmpbuf, recvbuf, recvcount * comm->size() * recvtype->size()); + //memcpy(??,nullptr,0) is actually undefined behavor, even if harmless. + if(recvbuf != nullptr) + memcpy(sendtmpbuf, recvbuf, recvcount * comm->size() * recvtype->size()); sendtmpcount = recvcount; sendtmptype = recvtype; }