projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
perf tools: Incorrect use of snprintf results in SEGV
[firefly-linux-kernel-4.4.55.git]
/
tools
/
perf
/
util
/
sort.c
diff --git
a/tools/perf/util/sort.c
b/tools/perf/util/sort.c
index f44fa541d56e67c6bb6c976e78123e99657ffbee..0ffbc8e5b4b5ef5a054ca3eab4a331c2c6c9f7be 100644
(file)
--- a/
tools/perf/util/sort.c
+++ b/
tools/perf/util/sort.c
@@
-122,6
+122,9
@@
static int repsep_snprintf(char *bf, size_t size, const char *fmt, ...)
}
}
va_end(ap);
+
+ if (n >= (int)size)
+ return size - 1;
return n;
}