summaryrefslogtreecommitdiffstats
path: root/usr.bin/ctags
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1998-04-19 18:00:49 +0000
committerphk <phk@FreeBSD.org>1998-04-19 18:00:49 +0000
commit01f3719f2f7f1be0b23edf84788aadb83add2727 (patch)
tree58a914872a94f879e7fdf418d9ac95bafe11d0cb /usr.bin/ctags
parentc85e9550d38f7dce77e104b455f522dfd7a8e665 (diff)
downloadFreeBSD-src-01f3719f2f7f1be0b23edf84788aadb83add2727.zip
FreeBSD-src-01f3719f2f7f1be0b23edf84788aadb83add2727.tar.gz
Ctags write to buffer beyond the end of it when the source file
doesn't end with '\n'. It brings segmentation fault. PR: 4812 Reviewed by: phk Submitted by: Shigio Yamaguchi <shigio@wafu.netgate.net>
Diffstat (limited to 'usr.bin/ctags')
-rw-r--r--usr.bin/ctags/print.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/ctags/print.c b/usr.bin/ctags/print.c
index b2c313a..bebdeb1 100644
--- a/usr.bin/ctags/print.c
+++ b/usr.bin/ctags/print.c
@@ -59,7 +59,7 @@ getline()
saveftell = ftell(inf);
(void)fseek(inf, lineftell, L_SET);
if (xflag)
- for (cp = lbuf; GETC(!=, '\n'); *cp++ = c)
+ for (cp = lbuf; GETC(!=, EOF) && c != '\n'; *cp++ = c)
continue;
/*
* do all processing here, so we don't step through the
OpenPOWER on IntegriCloud