Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
protect against bad buffer
authorAugustin Degomme <adegomme@users.noreply.github.com>
Sat, 6 Apr 2019 12:53:51 +0000 (14:53 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Sat, 6 Apr 2019 12:54:35 +0000 (14:54 +0200)
src/smpi/bindings/smpi_pmpi_coll.cpp

index 09324ed..c4f8183 100644 (file)
@@ -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;