Date: Thu, 10 May 2012 10:42:48 GMT From: "Alexey V. Panfilov" <ports@subnets.ru> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/167771: [patch] net-mgmt/mrtg fix rateup's coredump Message-ID: <201205101042.q4AAgmEk059293@red.freebsd.org> Resent-Message-ID: <201205101050.q4AAoAXK096192@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205101042.q4AAgmEk059293>