From: Tobias Oetiker Date: Tue, 19 Mar 2013 06:17:23 +0000 (+0100) Subject: fixed overflow probem with partial matching X-Git-Tag: 1.4.8~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd4cfab7f2a05950b15292bacd8a00251fdaa1e4;p=thirdparty%2Frrdtool-1.x.git fixed overflow probem with partial matching --- diff --git a/src/rrd_fetch.c b/src/rrd_fetch.c index 267fd952..79f1d402 100644 --- a/src/rrd_fetch.c +++ b/src/rrd_fetch.c @@ -374,8 +374,8 @@ int rrd_fetch_fn( rra_start_time = (rra_end_time - (*step * (rrd.rra_def[chosen_rra].row_cnt - 1))); /* here's an error by one if we don't be careful */ - start_offset = ((long) *start + *step - rra_start_time) / (long) *step; - end_offset = ((long) rra_end_time - *end) / (long) *step; + start_offset = ((long long) *start + (long long)*step - (long long)rra_start_time) / (long long) *step; + end_offset = ((long long) rra_end_time - (long long)*end) / (long long) *step; #ifdef DEBUG fprintf(stderr, "rra_start %lu, rra_end %lu, start_off %li, end_off %li\n",