]> sourceware.org Git - systemtap.git/commit
Flip user_string_n_quoted to limit the input count
authorJosh Stone <jistone@redhat.com>
Thu, 31 Oct 2013 22:03:34 +0000 (15:03 -0700)
committerJosh Stone <jistone@redhat.com>
Fri, 1 Nov 2013 07:13:40 +0000 (00:13 -0700)
commit7bec2c245805df53f3b22abd15ca53b36ab50fe7
treeef444227048c5eb172248f3a4b3f1ceedc4159a5
parent194aef3db3f64aa830ab7db973951cc39af555f2
Flip user_string_n_quoted to limit the input count

The documentation of that function implies that it's counting n from the
input string, but in fact that limit was being applied to the output,
including quotes and escaping.

Now _stp_text_str takes two length parameters to limit the input count
and output size separately.  A new user_string_n2_quoted() lets you
specify both of these lengths, and user_string_n_quoted now uses that to
limit input length, or output still in compatibility mode.

Several syscall tapsets which read user buffers of known length will now
use user_string_n2_quoted to fit that.  This was seen in syscall.write
which may not necessarily have any '\0' at the end of its buffer.
runtime/stp_string.c
runtime/stp_string.h
tapset/linux/nd_syscalls.stp
tapset/linux/nd_syscalls2.stp
tapset/linux/syscalls.stp
tapset/linux/syscalls2.stp
tapset/string.stp
tapset/uconversions.stp
testsuite/buildok/conversions-embedded.stp
This page took 0.0306 seconds and 5 git commands to generate.