diff options
author | Piotr Pawel Stefaniak <pstef@FreeBSD.org> | 2018-06-03 17:07:56 +0000 |
---|---|---|
committer | Piotr Pawel Stefaniak <pstef@FreeBSD.org> | 2018-06-03 17:07:56 +0000 |
commit | bef613ff2ff8c618082b4540c42f975bdeaf64a4 (patch) | |
tree | 6205346187a61feb769a96280f4e1ee800f062ad /usr.bin/indent | |
parent | 33c2464207beacc032cca0b2933dd9e2a5025afe (diff) | |
download | src-test2-bef613ff2ff8c618082b4540c42f975bdeaf64a4.tar.gz src-test2-bef613ff2ff8c618082b4540c42f975bdeaf64a4.zip |
Notes
Diffstat (limited to 'usr.bin/indent')
-rw-r--r-- | usr.bin/indent/indent.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c index e6a83a8a84a7..562031b0b6d6 100644 --- a/usr.bin/indent/indent.c +++ b/usr.bin/indent/indent.c @@ -1193,10 +1193,10 @@ check_type: *sc_end++ = ' '; --line_no; } + if (sc_end - save_com + com_end - com_start > sc_size) + errx(1, "input too long"); bcopy(s_lab + com_start, sc_end, com_end - com_start); sc_end += com_end - com_start; - if (sc_end >= &save_com[sc_size]) - errx(1, "input too long"); e_lab = s_lab + com_start; while (e_lab > s_lab && (e_lab[-1] == ' ' || e_lab[-1] == '\t')) e_lab--; |