Debian Codegraph @

testsuite/systemtap.string/user_string_n_quoted.stp

raw
1 # Ensure that user_string_n_quoted truncates properly by input length and
2 # there's no off-by-one error (see PR15617). Also ensures that
3 # user_string_n_quoted properly truncates by output length.
4 # We avoid using @MAXSTRINGLEN to not have to require -g
5
6 probe syscall.write {
7 if (pid() == target()) {
8 printf("%s\n", user_string_n_quoted(buf_uaddr, 15))
9 printf("%s\n", user_string_n_quoted(buf_uaddr, 14))
10 printf("%s\n", user_string_n_quoted(buf_uaddr, 13))
11 printf("%s\n", user_string_n_quoted(buf_uaddr, 99, 20))
12 printf("%s\n", user_string_n_quoted(buf_uaddr, 99, 19))
13 printf("%s\n", user_string_n_quoted(buf_uaddr, 99, 18))
14 printf("%s\n", user_string_n_quoted(buf_uaddr, 99, 17))
15 printf("%s\n", user_string_n_quoted(buf_uaddr, 99, 16))
16 exit()
17 }
18 }
19