[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2-191-g1946c82

Service Account noreply at mpich.org
Wed Feb 17 10:32:45 CST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  1946c8233aa77f4082c9754ef4a5f20b58898b2e (commit)
       via  8ccf8dcb538273d3092d6da141dd5a125c30eb89 (commit)
       via  5f86c3355f7a5d72b0e6606a3c44810d28205031 (commit)
      from  238a3f9a5228aa22388a0e1fd7458903e218bfc8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/1946c8233aa77f4082c9754ef4a5f20b58898b2e

commit 1946c8233aa77f4082c9754ef4a5f20b58898b2e
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Tue Feb 16 16:06:07 2016 -0600

    check errors in more cases
    
    Looks like c9254112ba missed one error case
    
    Coverity 122834
    
    Signed-off-by: Yanfei Guo <yguo at anl.gov>

diff --git a/src/pmi/simple/simple_pmi.c b/src/pmi/simple/simple_pmi.c
index 05859f4..70ccadf 100644
--- a/src/pmi/simple/simple_pmi.c
+++ b/src/pmi/simple/simple_pmi.c
@@ -683,7 +683,10 @@ int PMI_Spawn_multiple(int count,
 	if (rc != 0) {
 	    return PMI_FAIL;
 	}
-        PMIU_writeline( PMI_fd, buf );
+        rc = PMIU_writeline( PMI_fd, buf );
+	if (rc) {
+	    return PMI_FAIL;
+	}
     }
 
     PMIU_readline( PMI_fd, buf, PMIU_MAXLINE );

http://git.mpich.org/mpich.git/commitdiff/8ccf8dcb538273d3092d6da141dd5a125c30eb89

commit 8ccf8dcb538273d3092d6da141dd5a125c30eb89
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Tue Feb 16 10:01:02 2016 -0600

    don't overrun the 'key' buffer
    
    long ago this code used strncpy, so we needed room for the null.  But
    code will only alloate MAX_INFO_KEY bytes. good news:
    MPL_strncpy will always null-terminate.
    
    Coverity id: 105206
    
    Signed-off-by: Yanfei Guo <yguo at anl.gov>

diff --git a/src/mpi/info/info_getnth.c b/src/mpi/info/info_getnth.c
index c7253f2..d72d689 100644
--- a/src/mpi/info/info_getnth.c
+++ b/src/mpi/info/info_getnth.c
@@ -45,7 +45,9 @@ int MPIR_Info_get_nthkey_impl(MPID_Info *info_ptr, int n, char *key)
     /* verify that n is valid */
     MPIR_ERR_CHKANDJUMP2((!curr_ptr), mpi_errno, MPI_ERR_ARG, "**infonkey", "**infonkey %d %d", n, nkeys);
 
-    MPL_strncpy( key, curr_ptr->key, MPI_MAX_INFO_KEY+1 );
+    /* if key is MPI_MAX_INFO_KEY long, MPL_strncpy will null-terminate it for
+     * us */
+    MPL_strncpy( key, curr_ptr->key, MPI_MAX_INFO_KEY);
     /* Eventually, we could remember the location of this key in
        the head using the key/value locations (and a union datatype?) */
  

http://git.mpich.org/mpich.git/commitdiff/5f86c3355f7a5d72b0e6606a3c44810d28205031

commit 5f86c3355f7a5d72b0e6606a3c44810d28205031
Author: Rob Latham <robl at mcs.anl.gov>
Date:   Mon Feb 15 16:48:21 2016 -0600

    avoid possible buffer overrun
    
    CID #105201
    CID #105202
    CID #105203
    
    Signed-off-by: Yanfei Guo <yguo at anl.gov>

diff --git a/src/pm/hydra/ui/mpich/utils.c b/src/pm/hydra/ui/mpich/utils.c
index 2aa949f..9abe0b5 100644
--- a/src/pm/hydra/ui/mpich/utils.c
+++ b/src/pm/hydra/ui/mpich/utils.c
@@ -359,7 +359,7 @@ static void hostlist_help_fn(void)
 
 static HYD_status hostlist_fn(char *arg, char ***argv)
 {
-    char *hostlist[HYD_NUM_TMP_STRINGS];
+    char *hostlist[HYD_NUM_TMP_STRINGS+1]; /* +1 for null termination of list */
     int count = 0;
     HYD_status status = HYD_SUCCESS;
 
diff --git a/src/pm/hydra/utils/sock/sock.c b/src/pm/hydra/utils/sock/sock.c
index 93c5e94..9234c97 100644
--- a/src/pm/hydra/utils/sock/sock.c
+++ b/src/pm/hydra/utils/sock/sock.c
@@ -457,7 +457,7 @@ HYD_status HYDU_sock_get_iface_ip(char *iface, char **ip)
 
 #if defined(HAVE_GETIFADDRS)
     struct ifaddrs *ifaddr, *ifa;
-    char buf[INET_ADDRSTRLEN];
+    char buf[MAX_HOSTNAME_LEN];
     struct sockaddr_in *sa;
 
     /* Got the interface name; let's query for the IP address */
@@ -508,7 +508,7 @@ HYD_status HYDU_sock_is_local(char *host, int *is_local)
     char lhost[MAX_HOSTNAME_LEN];
     struct sockaddr_in sa;
     struct ifaddrs *ifaddr, *ifa;
-    char buf[INET_ADDRSTRLEN];
+    char buf[MAX_HOSTNAME_LEN];
     HYD_status status = HYD_SUCCESS;
 
     *is_local = 0;

-----------------------------------------------------------------------

Summary of changes:
 src/mpi/info/info_getnth.c     |    4 +++-
 src/pm/hydra/ui/mpich/utils.c  |    2 +-
 src/pm/hydra/utils/sock/sock.c |    4 ++--
 src/pmi/simple/simple_pmi.c    |    5 ++++-
 4 files changed, 10 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list