diff options
author | Karel Zak | 2006-12-07 00:25:48 +0100 |
---|---|---|
committer | Karel Zak | 2006-12-07 00:25:48 +0100 |
commit | 364cda4857f7dd5e2b4e2eb7583a2eaa279ef4ed (patch) | |
tree | c60dfad813ca42bf619fe2ac8ce893d2331e508f /sys-utils/readprofile.c | |
parent | Imported from util-linux-2.11b tarball. (diff) | |
download | kernel-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.c | 6 |
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; |