From: oetiker Date: Tue, 27 Sep 2011 06:15:36 +0000 (+0000) Subject: fix buffer overflow for LONG lines in journal handling code for update requests. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fb20712d32b07de5cd82f12d2896d37e2af805ee;p=rrdtool.git fix buffer overflow for LONG lines in journal handling code for update requests. fix for #316 git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2202 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c index 78426e6..c09999a 100644 --- a/src/rrd_daemon.c +++ b/src/rrd_daemon.c @@ -1328,7 +1328,7 @@ static int handle_request_update (HANDLER_PROTO) /* {{{ */ /* save it for the journal later */ if (!JOURNAL_REPLAY(sock)) - strncpy(orig_buf, buffer, buffer_size); + strncpy(orig_buf, buffer, min(CMD_MAX,buffer_size)); status = buffer_get_field (&buffer, &buffer_size, &file); if (status != 0)