From: eitan Date: Thu, 9 Mar 2006 13:12:29 +0000 (+0000) Subject: OpenSM: Trivial memory allocation bug in parsing opensm.opts X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=efa0d46d33fe003100d21ca1a1a379806bc7d9c2;p=~shefty%2Frdma-win.git OpenSM: Trivial memory allocation bug in parsing opensm.opts Allocation missed the null char. git-svn-id: svn://openib.tc.cornell.edu/gen1@236 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/ulp/opensm/user/opensm/osm_subnet.c b/trunk/ulp/opensm/user/opensm/osm_subnet.c index ff1ad691..41a92da8 100644 --- a/trunk/ulp/opensm/user/opensm/osm_subnet.c +++ b/trunk/ulp/opensm/user/opensm/osm_subnet.c @@ -593,7 +593,7 @@ __osm_subn_opts_unpack_charp( p_key, p_val_str); printf(buff); cl_log_event("OpenSM", LOG_INFO, buff, NULL, 0); - *p_val = (char *)cl_malloc(strlen(p_val_str)); + *p_val = (char *)cl_malloc( strlen(p_val_str) +1 ); strcpy( *p_val, p_val_str); } }