From: Augustin Degomme Date: Sat, 6 Apr 2019 12:53:51 +0000 (+0200) Subject: protect against bad buffer X-Git-Tag: v3.22.2~163^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a4129e0f81724054c885e3242f05996ffa9d501b protect against bad buffer --- diff --git a/src/smpi/bindings/smpi_pmpi_coll.cpp b/src/smpi/bindings/smpi_pmpi_coll.cpp index 09324ed52b..c4f8183dca 100644 --- a/src/smpi/bindings/smpi_pmpi_coll.cpp +++ b/src/smpi/bindings/smpi_pmpi_coll.cpp @@ -534,6 +534,8 @@ int PMPI_Iscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, M retval = MPI_ERR_ARG; } else if (count < 0){ retval = MPI_ERR_COUNT; + } else if (sendbuf == nullptr || recvbuf == nullptr){ + retval = MPI_ERR_BUFFER; } else { int rank = simgrid::s4u::this_actor::get_pid(); void* sendtmpbuf = sendbuf; @@ -580,6 +582,8 @@ int PMPI_Iexscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, retval = MPI_ERR_ARG; } else if (count < 0){ retval = MPI_ERR_COUNT; + } else if (sendbuf == nullptr || recvbuf == nullptr){ + retval = MPI_ERR_BUFFER; } else { int rank = simgrid::s4u::this_actor::get_pid(); void* sendtmpbuf = sendbuf;