From 8359bd75ef54df735a28b7ea23cbf10e17ead11b Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Wed, 9 Sep 2020 02:06:50 +0000 Subject: [PATCH] Adjust to ObjFW changes FossilOrigin-Name: 020bc36b4af8074862e2362743fa479d4741bb8b077f7687fdd8bd00e1d56ef4 --- CryptoPassphrase.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) {