Index: CryptoPassphrase.m ================================================================== --- CryptoPassphrase.m +++ CryptoPassphrase.m @@ -120,11 +120,17 @@ if (lengthString != nil) { 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) { invalid = true; }