summaryrefslogtreecommitdiffstats
path: root/sys-utils/readprofile.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:48 +0100
committerKarel Zak2006-12-07 00:25:48 +0100
commit364cda4857f7dd5e2b4e2eb7583a2eaa279ef4ed (patch)
treec60dfad813ca42bf619fe2ac8ce893d2331e508f /sys-utils/readprofile.c
parentImported from util-linux-2.11b tarball. (diff)
downloadkernel-qcow2-util-linux-364cda4857f7dd5e2b4e2eb7583a2eaa279ef4ed.tar.gz
kernel-qcow2-util-linux-364cda4857f7dd5e2b4e2eb7583a2eaa279ef4ed.tar.xz
kernel-qcow2-util-linux-364cda4857f7dd5e2b4e2eb7583a2eaa279ef4ed.zip
Imported from util-linux-2.11f tarball.
Diffstat (limited to 'sys-utils/readprofile.c')
-rw-r--r--sys-utils/readprofile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys-utils/readprofile.c b/sys-utils/readprofile.c
index 189322623..eee8634fe 100644
--- a/sys-utils/readprofile.c
+++ b/sys-utils/readprofile.c
@@ -218,6 +218,12 @@ main (int argc, char **argv) {
if (*mode == 'A' && total == 0) continue;
if (*mode!='T' && *mode!='t') break;/* only text is profiled */
+ if (indx >= len / sizeof(*buf)) {
+ fprintf(stderr, _("%s: profile address out of range. "
+ "Wrong map file?\n"), prgname);
+ exit(1);
+ }
+
while (indx < (next_add-add0)/step)
this += buf[indx++];
total += this;