Research Menu

.
Skip Search Box

SELinux Mailing List

Re: [patch 1/3] libsemanage: genhomedircon replacement

From: Steve G <linux_4ever_at_yahoo.com>
Date: Thu, 24 May 2007 08:05:57 -0700 (PDT)

<snip>
> > + for (h = homedirs; h; h = h->next) {
> > + s1len = strlen(h->data);
> > + temp = malloc(s1len + sizeof("/[^/]*"));
> > + strcpy(temp, h->data);
> > + strcpy(temp + s1len, "/[^/]*");

could be:

for (h = homedirs; h; h = h->next) {

    asprintf(&temp, "%s/[^/]*", h->data);

> > +char *semanage_findval(char *file, char *var, char *delim)
> > +{
> > + FILE *fd;
> > +
> > + char *buff;
> > + char *temp = NULL;
> > +
> > + if (!file || !var || !delim)
> > + return NULL;
>
> assert?

Assert is bad as it calls SIGABRT. SIGABRT means dump core. Production software should not be dumping core as a habit.

-Steve        

____________________________________________________________________________________Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. http://tv.yahoo.com/collections/222
--
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 Thu 24 May 2007 - 11:06:27 EDT
 

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

 
bottom

National Security Agency / Central Security Service