]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
ibacm: define prov_lib_path as a char array
authorKaike Wan <kaike.wan@intel.com>
Mon, 7 Jul 2014 17:36:25 +0000 (10:36 -0700)
committerSean Hefty <sean.hefty@intel.com>
Mon, 7 Jul 2014 17:36:25 +0000 (10:36 -0700)
This patch fixes a segfault error when the option file defines the provider
lib path. The variable prov_lib_path should be a buffer (char array) instead
of a char pointer. This allows a string to be copied into it during option
parsing.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/acm.c

index 8f147ef570cc03b87ecea714df9a840114103986..fae9d0bf2326124f573980adf9b5e5e0b2e831cd 100644 (file)
--- a/src/acm.c
+++ b/src/acm.c
@@ -193,7 +193,7 @@ static int log_level = 0;
 static char lock_file[128] = "/var/run/ibacm.pid";
 static short server_port = 6125;
 static int support_ips_in_addr_cfg = 0;
-static char *prov_lib_path = IBACM_LIB_PATH;
+static char prov_lib_path[256] = IBACM_LIB_PATH;
 
 void acm_write(int level, const char *format, ...)
 {