This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug runtime/22991] Invalid truncation of quoted strings


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]