lkml.org 
[lkml]   [2016]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/3] perf script python: Fix string vs byte array resolving
    On Fri, Jul 15, 2016 at 01:18:40PM -0400, Steven Rostedt wrote:
    > On Fri, 15 Jul 2016 09:29:55 +0200
    > Jiri Olsa <jolsa@kernel.org> wrote:
    >
    > > + if (field->flags & FIELD_IS_STRING &&
    > > + is_printable_array(data + offset, len)) {
    > > + obj = PyString_FromString((char *) data + offset);
    >
    > Hmm. As I stated, It is possible that strings can be non nul
    > terminated. But I'm looking here and thinking we need to make sure that
    > it is nul terminated.
    >
    > Can PyString_FromString() handle a non nul terminated string?

    couldn't find in the doc.. but I think it's necessary,
    there's no other way it could tell the end ;-)

    I'll make the is_printable_array in case the final 0 is missing

    thanks,
    jirka

    \
     
     \ /
      Last update: 2016-07-16 18:41    [W:2.487 / U:0.232 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site