Explorar o código

quorumtool: Assert copied string length

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
(cherry picked from commit 56ee850301ae08213e19a163443a8d0f0b5068aa)
Jan Friesse %!s(int64=6) %!d(string=hai) anos
pai
achega
cab6efee80
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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);
 	}