[Bug runtime/22991] Invalid truncation of quoted strings
georg.schoelly at joesecurity dot org
sourceware-bugzilla@sourceware.org
Thu Apr 19 08:16:00 GMT 2018
https://sourceware.org/bugzilla/show_bug.cgi?id=22991
Georg <georg.schoelly at joesecurity dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |VERIFIED
--- Comment #4 from Georg <georg.schoelly at joesecurity dot org> ---
Thank you for fixing this! I found one more edge case.
Test case
=========
> probe oneshot {
> printf("%s\n", string_quoted("This is a \\test", 18));
> printf("%s\n", string_quoted("This is a \\test", 17));
> printf("%s\n", string_quoted("This is a \\test", 16));
> // \xc3\xb6 is utf-8 for latin small o with diareses
> printf("%s\n", string_quoted("This is a \xc3\xb6", 18));
> printf("%s\n", string_quoted("This is a \xc3\xb6", 17));
> printf("%s\n", string_quoted("This is a \xc3\xb6", 16));
> }
>
>
> /* same as string_quoted in tapset/string.stp with
> * an additional length parameter */
> function string_quoted:string (str:string, len:long) %{
> (void) _stp_text_str(STAP_RETVALUE,
> (char *)(uintptr_t)STAP_ARG_str,
> STAP_ARG_len, STAP_ARG_len, 1, 0, 0);
> %}
Expected Result
===============
> "This is a \\test"
> "This is a \\"...
> "This is a "...
> "This is a \u00F6"
> "This is a "...
> "This is a "...
Actual Result
=============
> "This is a \\test"
> "This is a \\"...
> "This is a "...
> "This is a \u00F6"
> "This is a \u"... <- broken char
> "This is a \"... <- broken char
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Systemtap
mailing list