From owner-freebsd-ports-bugs@FreeBSD.ORG Thu May 10 10:50:10 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4663106564A for ; Thu, 10 May 2012 10:50:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 923288FC0C for ; Thu, 10 May 2012 10:50:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q4AAoAkR096193 for ; Thu, 10 May 2012 10:50:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q4AAoAXK096192; Thu, 10 May 2012 10:50:10 GMT (envelope-from gnats) Resent-Date: Thu, 10 May 2012 10:50:10 GMT Resent-Message-Id: <201205101050.q4AAoAXK096192@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Alexey V. Panfilov" Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F137D1065670 for ; Thu, 10 May 2012 10:42:48 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id DBC038FC14 for ; Thu, 10 May 2012 10:42:48 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q4AAgmvL059303 for ; Thu, 10 May 2012 10:42:48 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q4AAgmEk059293; Thu, 10 May 2012 10:42:48 GMT (envelope-from nobody) Message-Id: <201205101042.q4AAgmEk059293@red.freebsd.org> Date: Thu, 10 May 2012 10:42:48 GMT From: "Alexey V. Panfilov" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/167771: [patch] net-mgmt/mrtg fix rateup's coredump X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 May 2012 10:50:11 -0000 >Number: 167771 >Category: ports >Synopsis: [patch] net-mgmt/mrtg fix rateup's coredump >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Thu May 10 10:50:10 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Alexey V. Panfilov >Release: 8.3-STABLE amd64 >Organization: Meganet-2003 LLC >Environment: FreeBSD wco-mur.atvnet.com.br 8.3-STABLE FreeBSD 8.3-STABLE #0: Sat Apr 28 03:28:18 BRT 2012 hmm@wco-mur.atvnet.com.br:/usr/obj/usr/src/sys/wco8 amd64 >Description: Reported via private mail: "problem appeared after 2.16.4,1 => 2.17.4,7, my log is flooded by every run with: kernel: pid 90528 (rateup), uid 0: exited on signal 11 (core dumped) a tipical KMG setting is kMG[whatever]: ,M,G, when I comment this line rateup conlcudes without error funny is, the graph is still updated, so seems rateup dies after doing it's job" >How-To-Repeat: Compose config with option kMG. >Fix: Apply diff (between 2.17.4 release and current): http://oss.oetiker.ch/mrtg-trac/changeset?reponame=&new=402@trunk%2Fsrc%2Fsrc%2Frateup.c&old=397@trunk%2Fsrc%2Fsrc%2Frateup.c Patch attached with submission follows: --- src/rateup.c.orig 2012-05-10 05:40:49.259760823 -0300 +++ src/rateup.c 2012-05-10 05:44:32.297657818 -0300 @@ -1132,9 +1132,10 @@ gdImageDestroy (brush_outp); free (lhist); free (graph_label); - if (kMG) + if (kMG) { free(short_si); - + short_si = short_si_def; + } #ifdef WIN32 /* got to remove the target under win32 @@ -1563,8 +1564,10 @@ } else { - strcpy (last.in, in); - strcpy (last.out, out); + strncpy (last.in, in, MAXL); + last.in[MAXL-1]='\0'; + strncpy (last.out, out,MAXL); + last.out[MAXL-1]='\0'; } fprintf (fo, "%lu " LLD " " LLD " " LLD " " LLD "\n", (unsigned long) now, inrate, outrate, inrate, outrate); @@ -2114,6 +2117,7 @@ history[x].in = rand () % atoi (argv[argi + 1]); history[x].out = rand () % atoi (argv[argi + 2]); } + /* fallthrough */ case 'u': /* Update file */ if (argv[argi][1] == 'p') { >Release-Note: >Audit-Trail: >Unformatted: