File setools-snprintf-warnings.patch of Package setools.10737

Index: setools-4.1.0/libqpol/policy_extend.c
===================================================================
--- setools-4.1.0.orig/libqpol/policy_extend.c	2017-01-24 00:35:06.000000000 +0100
+++ setools-4.1.0/libqpol/policy_extend.c	2019-03-26 14:01:21.851540455 +0100
@@ -125,7 +125,7 @@ static int qpol_policy_build_attrs_from_
 	uint32_t bit = 0, count = 0;
 	ebitmap_node_t *node = NULL;
 	type_datum_t *tmp_type = NULL, *orig_type;
-	char *tmp_name = NULL, buff[10];
+	char *tmp_name = NULL, buff[25];
 	int error = 0, retv;
 
 	INFO(policy, "%s", "Generating attributes for policy. (Step 4 of 5)");
@@ -137,7 +137,7 @@ static int qpol_policy_build_attrs_from_
 
 	db = &policy->p->p;
 
-	memset(&buff, 0, 10 * sizeof(char));
+	memset(&buff, 0, 25 * sizeof(char));
 
 	for (i = 0; i < db->p_types.nprim; i++) {
 		/* skip types */
@@ -158,7 +158,7 @@ static int qpol_policy_build_attrs_from_
 		 * with this attribute */
 		/* Does not exist */
 		if (db->p_type_val_to_name[i] == NULL){
-			snprintf(buff, 9, "@ttr%04zd", i + 1);
+			snprintf(buff, 24, "@ttr%04zd", i + 1);
 			tmp_name = strdup(buff);
 			if (!tmp_name) {
 				error = errno;
openSUSE Build Service is sponsored by