diff --git a/ompi/mpi/c/publish_name.c b/ompi/mpi/c/publish_name.c index 1e133a71bb..8a144a3efd 100644 --- a/ompi/mpi/c/publish_name.c +++ b/ompi/mpi/c/publish_name.c @@ -41,11 +41,11 @@ int MPI_Publish_name(char *service_name, MPI_Info info, if ( MPI_PARAM_CHECK ) { OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if ( NULL == port_name ) { + if ( NULL == port_name || 0 == strlen(port_name) ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); } - if ( NULL == service_name ) { + if ( NULL == service_name || 0 == strlen(service_name) ) { return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME); }