[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160716155808.GA16531@krava>
Date: Sat, 16 Jul 2016 17:58:08 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Jiri Olsa <jolsa@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Pirko <jiri@...lanox.com>,
lkml <linux-kernel@...r.kernel.org>,
David Ahern <dsahern@...il.com>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [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@...nel.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
Powered by blists - more mailing lists