]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Create rrd file: Allow only short integer numbers in rpn formula
authorpetgit <mo1607bil>
Sun, 13 Jul 2014 14:24:13 +0000 (16:24 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Sun, 13 Jul 2014 15:51:33 +0000 (17:51 +0200)
src/rrd_rpncalc.c

index 0920fce3c142fc9e0b5d351445fbef98b029ba80..a96c588c88abca0ba291336800796c878a4b3289 100644 (file)
@@ -46,7 +46,7 @@ short rpn_compact(
             /* rpnp.val is a double, rpnc.val is a short */
             double    temp = floor(rpnp[i].val);
 
-            if (temp < SHRT_MIN || temp > SHRT_MAX) {
+                       if (temp < SHRT_MIN || temp > SHRT_MAX || temp != rpnp[i].val) {
                 rrd_set_error
                     ("constants must be integers in the interval (%d, %d)",
                      SHRT_MIN, SHRT_MAX);