Research Menu

.
Skip Search Box

SELinux Mailing List

fix for segfault in getconlist of libselinux-1.22

From: Andreas Steinmetz <ast_at_domdv.de>
Date: Sun, 03 Apr 2005 19:36:48 +0200


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

-- 
Andreas Steinmetz                       SPAMmers use robotrap@domdv.de

diff -rNu libselinux-1.22.orig/utils/getconlist.c libselinux-1.22/utils/getconlist.c --- libselinux-1.22.orig/utils/getconlist.c 2004-11-01 15:21:46.000000000 +0100 +++ libselinux-1.22/utils/getconlist.c 2005-03-29 13:13:13.000000000 +0200 @@ -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; -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with the words "unsubscribe selinux" without quotes as the message.

Received on Sun 3 Apr 2005 - 13:38:45 EDT
 

Date Posted: Jan 15, 2009 | Last Modified: Jan 15, 2009 | Last Reviewed: Jan 15, 2009

 
bottom

National Security Agency / Central Security Service