Research Menu

.
Skip Search Box

SELinux Mailing List

Re: policyrep questions

From: Karl MacMillan <kmacmillan_at_mentalrootkit.com>
Date: Wed, 09 May 2007 10:13:25 -0400


On Tue, 2007-05-08 at 18:29 -0400, Karl MacMillan wrote:
>
> 3) The existing objects copy the passed in strings where I was hoping to
> avoid the copy. Any opinions either way? I'm currently leaning towards
> copying because that kind of change will create hard to track down bugs
> for no good reason.
>

To make things more confusing - some of the existing code copies strings while others do not. For example sepol_bool_set_name copies the string while sepol_bool_key_create does not. I assume that the thought was that the keys were temporary and likely to be populated from other sources (existing bools, user input, etc.).

However - I think that this inconsistency is just confusing. I'm going to change all of the functions to copy the strings. Changing in this direction means the worst case is that a few strings will be leaked.

Karl

--
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 Wed 9 May 2007 - 10:14:28 EDT
 

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

 
bottom

National Security Agency / Central Security Service