All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roberts, William C" <william.c.roberts@intel.com>
To: Stephen Smalley <sds@tycho.nsa.gov>,
	"selinux@tycho.nsa.gov" <selinux@tycho.nsa.gov>,
	"seandroid-list@tycho.nsa.gov" <seandroid-list@tycho.nsa.gov>,
	"jwcart2@tycho.nsa.gov" <jwcart2@tycho.nsa.gov>
Subject: RE: [PATCH v2] libselinux: clean up process file
Date: Thu, 8 Sep 2016 19:30:28 +0000	[thread overview]
Message-ID: <476DC76E7D1DF2438D32BFADF679FC560128FA5C@ORSMSX103.amr.corp.intel.com> (raw)
In-Reply-To: 513c68e1-06e5-570d-3106-cf033b1e3040@tycho.nsa.gov

<snip>

> > > +	/* Append any given suffix */
> > > +	char *to = stpcpy(&current[current_size], ".");
> >
> > Simpler as:
> > 	char *to = current + current_size;
> > 	*to++ = '.';
> 
> I don't think this is simpler, but I'll do it.

Doing that as is gets us this:
==26050== Conditional jump or move depends on uninitialised value(s)
==26050==    at 0x4C2DD9A: strcat (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==26050==    by 0x4E4B6D8: rolling_append (label_file.c:429)
==26050==    by 0x4E4B8A3: open_file (label_file.c:472)
==26050==    by 0x4E4BAC6: process_file (label_file.c:519)
==26050==    by 0x4E4BE6D: init (label_file.c:582)
==26050==    by 0x4E4D02B: selabel_file_init (label_file.c:965)
==26050==    by 0x4E481F5: selabel_open (label.c:340)
==26050==    by 0x4E513E0: matchpathcon_init_prefix (matchpathcon.c:322)
==26050==    by 0x4E51725: matchpathcon (matchpathcon.c:413)
==26050==    by 0x400D86: printmatchpathcon (matchpathcon.c:26)
==26050==    by 0x40141F: main (matchpathcon.c:196)

Because strcat() needs to fastforward to the null byte, this would need to
change to an strcpy.

<snip>

  parent reply	other threads:[~2016-09-08 19:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07  0:07 [PATCH v2] libselinux: clean up process file william.c.roberts
2016-09-08 15:14 ` Stephen Smalley
2016-09-08 19:06   ` Roberts, William C
2016-09-08 19:20   ` Roberts, William C
2016-09-08 19:30   ` Roberts, William C [this message]
2016-09-08 19:40     ` Stephen Smalley
2016-09-08 19:44       ` Roberts, William C
2016-09-08 19:53   ` Roberts, William C

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=476DC76E7D1DF2438D32BFADF679FC560128FA5C@ORSMSX103.amr.corp.intel.com \
    --to=william.c.roberts@intel.com \
    --cc=jwcart2@tycho.nsa.gov \
    --cc=sds@tycho.nsa.gov \
    --cc=seandroid-list@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.