summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2017-08-29 18:21:29 +0200
committerJay Berkenbilt <ejb@ql.org>2017-08-29 18:28:32 +0200
commit6d46346eb93d5032c08cf1e39023b5d57260a766 (patch)
tree6bbb6f3347bee0f402672ab82c0af8ec402c30f1 /include
parentd7d446e0b8aacd122d1a000d38ebafa4dbf5b3d2 (diff)
downloadqpdf-6d46346eb93d5032c08cf1e39023b5d57260a766.tar.zst
Detect integer overflow/underflow
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QUtil.hh4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh
index 2c58475c..79db229f 100644
--- a/include/qpdf/QUtil.hh
+++ b/include/qpdf/QUtil.hh
@@ -29,8 +29,12 @@ namespace QUtil
QPDF_DLL
std::string double_to_string(double, int decimal_places = 0);
+ // These string to number methods throw std::runtime_error on
+ // underflow/overflow.
QPDF_DLL
long long string_to_ll(char const* str);
+ QPDF_DLL
+ int string_to_int(char const* str);
// Pipeline's write method wants unsigned char*, but we often have
// some other type of string. These methods do combinations of