diff mbox

multipath-tools/libmultipath discovery.c structs.h

Message ID 20100528045326.10188.qmail@sourceware.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

bmarzins@sourceware.org May 28, 2010, 4:53 a.m. UTC
None
diff mbox

Patch

--- multipath-tools/libmultipath/discovery.c	2010/05/25 23:23:07	1.28.2.8
+++ multipath-tools/libmultipath/discovery.c	2010/05/28 04:53:25	1.28.2.9
@@ -552,7 +552,7 @@ 
 	}
 	if (0 <= readattr(attr_path, attr_buff) && strlen(attr_buff) > 0)
 		strncpy(curpath->tgt_node_name, attr_buff,
-			strlen(attr_buff) - 1);
+			NODE_NAME_SIZE - 1);
 	else {
 		if(safe_sprintf(attr_path,
 			"%s/class/iscsi_transport/target%i:%i:%i/target_name",
@@ -566,8 +566,9 @@ 
 		if (0 <= readattr(attr_path, attr_buff) &&
 		    strlen(attr_buff) > 0)
 			strncpy(curpath->tgt_node_name, attr_buff,
-				strlen(attr_buff) - 1);
+				NODE_NAME_SIZE - 1);
 	}
+	curpath->tgt_node_name[NODE_NAME_SIZE - 1] = '\0';
 	condlog(3, "tgt_node_name = %s", curpath->tgt_node_name);
 
 	return 0;
--- multipath-tools/libmultipath/structs.h	2009/01/17 00:46:51	1.17.2.9
+++ multipath-tools/libmultipath/structs.h	2010/05/28 04:53:25	1.17.2.10
@@ -5,7 +5,7 @@ 
 
 #define WWID_SIZE		128
 #define SERIAL_SIZE		64
-#define NODE_NAME_SIZE		19
+#define NODE_NAME_SIZE		224
 #define PATH_STR_SIZE  		16
 #define PARAMS_SIZE		1024
 #define FILE_NAME_SIZE		256