Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1444870

Re: [PATCH 1/3] perf script python: Fix string vs byte array resolving

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] perf script python: Fix string vs byte array resolving
Date 2016-07-16 18:00 +0200
Message-ID <rVAau-5Du-11@gated-at.bofh.it> (permalink)
References <rV5T3-43Z-9@gated-at.bofh.it> <rV5T3-43Z-7@gated-at.bofh.it> <rVeWm-1cu-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] perf script python: Fix string vs byte array resolving Jiri Olsa <jolsa@kernel.org> - 2016-07-15 09:40 +0200
  Re: [PATCH 1/3] perf script python: Fix string vs byte array  resolving Jiri Olsa <jolsa@redhat.com> - 2016-07-15 09:40 +0200
  Re: [PATCH 1/3] perf script python: Fix string vs byte array  resolving Steven Rostedt <rostedt@goodmis.org> - 2016-07-15 17:40 +0200
  Re: [PATCH 1/3] perf script python: Fix string vs byte array  resolving Steven Rostedt <rostedt@goodmis.org> - 2016-07-15 18:10 +0200
    Re: [PATCH 1/3] perf script python: Fix string vs byte array  resolving Jiri Olsa <jolsa@redhat.com> - 2016-07-15 18:20 +0200
      Re: [PATCH 1/3] perf script python: Fix string vs byte array  resolving Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-15 18:40 +0200
      Re: [PATCH 1/3] perf script python: Fix string vs byte array  resolving Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-15 18:40 +0200
      Re: [PATCH 1/3] perf script python: Fix string vs byte array  resolving Steven Rostedt <rostedt@goodmis.org> - 2016-07-15 19:20 +0200
  Re: [PATCH 1/3] perf script python: Fix string vs byte array  resolving Steven Rostedt <rostedt@goodmis.org> - 2016-07-15 19:20 +0200
    Re: [PATCH 1/3] perf script python: Fix string vs byte array  resolving Jiri Olsa <jolsa@redhat.com> - 2016-07-16 18:00 +0200

csiph-web