This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug runtime/22991] Invalid truncation of quoted strings
- From: "amerey at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Thu, 19 Apr 2018 16:51:02 +0000
- Subject: [Bug runtime/22991] Invalid truncation of quoted strings
- Auto-submitted: auto-generated
- References: <bug-22991-6586@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=22991
--- Comment #5 from Aaron Merey <amerey at redhat dot com> ---
(In reply to Georg from comment #4)
> 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
Thanks for pointing this out Georg. Fixed in commit d4a446cceca.
--
You are receiving this mail because:
You are the assignee for the bug.