]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/config: detect overflow of int values
authorKefu Chai <kchai@redhat.com>
Wed, 29 Apr 2015 07:41:08 +0000 (15:41 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 29 Apr 2015 12:36:50 +0000 (05:36 -0700)
commitd62f80dc7b25d312ff05b65b7be854aae15b66a8
tree0204f6eabed1cf28c245245772f852bb3dadb2b7
parent9948e1ead9a4cb2bafe7ac85392ce6054b4ce554
common/config: detect overflow of int values

* #include "strtol.h" in strtol.cc, to ensure the function defintions
  are consistent.
* add a test accordingly
* fix the testcase of converting 1024E.
* do not accept integers overflow after adding SI suffix
* do not accept integers underflow (i.e. negative values)

Fixes: #11484
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/config.cc
src/common/strtol.cc
src/common/strtol.h
src/test/daemon_config.cc
src/test/strtol.cc