summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Schleifer <js@nil.im>2020-09-09 02:06:50 +0000
committerJonathan Schleifer <js@nil.im>2020-09-09 02:06:50 +0000
commit8359bd75ef54df735a28b7ea23cbf10e17ead11b (patch)
tree486e7b0d7f7ad8fbd40fb5a22b2c947ce91c7090
parent06a5fb81fa7d1fc190762072da31a095e212eb8b (diff)
Adjust to ObjFW changes
FossilOrigin-Name: 020bc36b4af8074862e2362743fa479d4741bb8b077f7687fdd8bd00e1d56ef4
-rw-r--r--CryptoPassphrase.m8
1 files changed, 7 insertions, 1 deletions
diff --git a/CryptoPassphrase.m b/CryptoPassphrase.m
index 3486d28..6ecfa76 100644
--- a/CryptoPassphrase.m
+++ b/CryptoPassphrase.m
@@ -122,7 +122,13 @@ showHelp(OFStream *output, bool verbose)
bool invalid = false;
@try {
- generator.length = (size_t)lengthString.decimalValue;
+ unsigned long long length =
+ lengthString.unsignedLongLongValue;
+
+ if (length > SIZE_MAX)
+ @throw [OFOutOfRangeException exception];
+
+ generator.length = (size_t)length;
} @catch (OFInvalidFormatException *e) {
invalid = true;
} @catch (OFOutOfRangeException *e) {