From: Jiri Olsa Date: Mon, 5 Oct 2015 18:06:03 +0000 (+0200) Subject: perf annotate: Fix sizeof_sym_hist overflow issue X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=5ec4502d774699194952209ff3ebe65d2472e15a;p=openwrt%2Fstaging%2Fblogic.git perf annotate: Fix sizeof_sym_hist overflow issue The annotated_source::sizeof_sym_hist could easily overflow int size, resulting in crash in __symbol__inc_addr_samples. Changing its type int size_t as was probably intended from beginning based on the initialization code in symbol__alloc_hist. Signed-off-by: Jiri Olsa Cc: David Ahern Cc: Don Zickus Cc: Kan Liang Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1444068369-20978-4-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index e9996092a093..cea323d9ee7e 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -122,7 +122,7 @@ struct annotated_source { struct list_head source; struct source_line *lines; int nr_histograms; - int sizeof_sym_hist; + size_t sizeof_sym_hist; struct cyc_hist *cycles_hist; struct sym_hist histograms[0]; };