[apparmor] [PATCH 2/6] libapparmor: Don't count NUL terminator byte

Seth Arnold seth.arnold at canonical.com
Thu May 14 19:26:16 UTC 2015


On Thu, May 14, 2015 at 01:01:33AM -0500, Tyler Hicks wrote:
> > Is this size++ now incorrect? (I was going to suggest it be deleted
> > because it isn't used further in this patch, but size is used as the
> > return value for the function. Perhaps the return value should also be
> > amended to (nul - buf)?)
> 
> The size++ is still correct. The aa_getcon(2) family of functions
> includes any NUL bytes in their return values:
> 
>   RETURN VALUE
>        On success size of data placed in the buffer is returned, this includes
>        the mode if present and any terminating characters. On error, -1 is
>        returned, and errno(3) is set appropriately.
> 
> This patch only changes the size passed into parse_confinement_mode(). The
> return value of aa_getprocattr_raw() intentionally still counts the NUL bytes
> read into buf.

Okay, then...

Acked-by: Seth Arnold <seth.arnold at canonical.com>

Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150514/7af87c69/attachment.pgp>


More information about the AppArmor mailing list