lkml.org 
[lkml]   [2012]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 13/13] perf, tool: Support for dwarf mode callchain on perf record
On 8/1/12 4:11 AM, Jiri Olsa wrote:
> +static int
> +parse_callchain_opt(const struct option *opt __used, const char *arg,
> + int unset)
> +{
> + struct perf_record *rec = (struct perf_record *)opt->value;
> + char *tok, *name, *saveptr = NULL;
> + char buf[20];
> + int ret = -1;
> +
> + /* --no-call-graph */
> + if (unset)
> + return 0;
> +
> + /* We specified default option if none is provided. */
> + BUG_ON(!arg);
> +
> + /* We need buffer that we know we can write to. */
> + snprintf(buf, 20, "%s", arg);

Isn't arg the user supplied string? What if the user messes up and
passes in 20+ characters to -g argument?

David


\
 
 \ /
  Last update: 2012-08-01 17:01    [W:0.080 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site