summaryrefslogtreecommitdiffstats
path: root/usr.sbin/fifolog/lib
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2010-05-15 08:57:16 +0000
committerphk <phk@FreeBSD.org>2010-05-15 08:57:16 +0000
commit0d79835fcf4f07a7a5049f8117ad7b2f4d850f89 (patch)
tree467cdddd67855ea895e1d791b94596c6d6be3076 /usr.sbin/fifolog/lib
parent85e899cc9ab353bf77ab4847690e5cdb554d746c (diff)
downloadFreeBSD-src-0d79835fcf4f07a7a5049f8117ad7b2f4d850f89.zip
FreeBSD-src-0d79835fcf4f07a7a5049f8117ad7b2f4d850f89.tar.gz
Do not attempt to render a logrecord with length byte, until we have
decompressed all the bytes required.
Diffstat (limited to 'usr.sbin/fifolog/lib')
-rw-r--r--usr.sbin/fifolog/lib/fifolog_reader.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.sbin/fifolog/lib/fifolog_reader.c b/usr.sbin/fifolog/lib/fifolog_reader.c
index 77e586f..6f18fbb 100644
--- a/usr.sbin/fifolog/lib/fifolog_reader.c
+++ b/usr.sbin/fifolog/lib/fifolog_reader.c
@@ -225,6 +225,8 @@ fifolog_reader_chop(struct fifolog_reader *fr, fifolog_reader_render_t *func, vo
if (u & FIFOLOG_LENGTH) {
v = p[w];
w++;
+ if (p + w + v >= q)
+ return (p);
} else {
for (v = 0; p + v + w < q && p[v + w] != '\0'; v++)
continue;
OpenPOWER on IntegriCloud