~tyhicks/apparmor/for-jj

Viewing all changes in revision 2618.

  • Committer: Tyler Hicks
  • Date: 2014-08-27 21:37:44 UTC
  • Revision ID: tyhicks@canonical.com-20140827213744-7erhe50jzhpi5qnw
parser: Adjust writeu16() to output escaped byte sequences

The writeu16() function was outputting unescaped byte sequences to the
rule buffer. That resulted the generation of in an incomplete rule if
one of those unescaped byte sequences contained 0x00.

This patch uses u8 pointers, instead of char pointers, when writing out
the big endian u16 value. More importantly, it casts the u8 values to
unsigned ints, which is what's needed to get the properly escaped byte
sequences.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: