Skip to contentSkip to conversation

fix for segfault in getconlist of libselinux-1.22

PATCH Andreas Steinmetz 2 participants 2 messages Apr 3, 2005 – Apr 4, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

fix for segfault in case of non-exisiting user attached.

Signature · 1 line
Andreas Steinmetz                       SPAMmers use [email protected]
utils/getconlist.c +5 -3
diff -rNu libselinux-1.22.orig/utils/getconlist.c libselinux-1.22/utils/getconlist.c
@@ -38,10 +38,12 @@
 
 	/* Get the list and print it */
 	ret = get_ordered_context_list(argv[1], cur_context, &list);
-	for (i = 0; list[i]; i++)
-		puts (list[i]);
+	if(ret != -1) {
+		for (i = 0; list[i]; i++)
+			puts (list[i]);
+		freeconary(list);
+	}
 
-	freeconary(list);
 	free(usercon);
 
 	return 0;
#1 lore raw
Quoted 1 line · Andreas Steinmetz

fix for segfault in case of non-exisiting user attached.

Thanks, merged as of libselinux 1.23.4.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.