瀏覽代碼

quorumtool: Assert copied string length

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
(cherry picked from commit 56ee850301ae08213e19a163443a8d0f0b5068aa)
Jan Friesse 6 年之前
父節點
當前提交
cab6efee80
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      tools/corosync-quorumtool.c

+ 1 - 0
tools/corosync-quorumtool.c

@@ -332,6 +332,7 @@ static const char *node_name(uint32_t nodeid, name_format_t name_format)
 	if ((nodelist_name) &&
 	    (strlen(nodelist_name) > 0)) {
 		start_addr = 1;
+		assert(strlen(nodelist_name) < sizeof(buf));
 		strcpy(buf, nodelist_name);
 		bufptr = strlen(buf);
 	}