Re: Bug#573638: rrdtool: rrdcgi crashes at printlasttime()

Tobias Oetiker <[email protected]>
Newsgroups gmane.comp.db.rrdtool.devel
Message-ID <[email protected]>
Hi Robert,

Yesterday Robert Luberda wrote:

> Tobias Oetiker writes:
>
> Hi Tobias,
>
> > in 2012:2013 I put in the patch below ... this should provide a
> > more generic fix for the problem. rrd_cgi functions all used to
> > fail horribly when a librrd function tried to touch ARGV[0] (mostly
>
>
> The patch fixes the crash, but you still need to fix the printlasttime()
> function by removing `+ 1' in line 991. I mean replacing
>   last = rrd_last(argc + 1, (char **) args - 1);
> with
>   last = rrd_last(argc, (char **) args - 1);
>
> Without the change, iptotal gives the following output:
>   Network usage
>   Database last updated:    [ERROR: Usage: rrdtool rrdcgi [--daemon ] ]
>   Server Time: 	Sun Mar 14 21:36:35 20
>
> After removing the `+ 1' thing, iptotal works as expected and prints
> time instead of the usage error message.

right, because the strftime argument is used locally and not passed
on to rrd_last ...

fix is in r2029:2030

thanks
tobi


>
> Thanks a lot,
> Robert
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch [email protected] ++41 62 775 9902 / sb: -9900
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.