From 364cda4857f7dd5e2b4e2eb7583a2eaa279ef4ed Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 7 Dec 2006 00:25:48 +0100 Subject: Imported from util-linux-2.11f tarball. --- sys-utils/readprofile.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys-utils/readprofile.c') 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; -- cgit v1.2.3-55-g7522