diff options
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; |