@@ -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;
@@ -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