Sfoglia il codice sorgente

quorumtool: Assert copied string length

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Jan Friesse 6 anni fa
parent
commit
56ee850301
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      tools/corosync-quorumtool.c

+ 1 - 0
tools/corosync-quorumtool.c

@@ -334,6 +334,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);
 	}