]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/idea/i_ofb64.c
threads_pthread.c: change inline to ossl_inline
[thirdparty/openssl.git] / crypto / idea / i_ofb64.c
index bca1999ef9d85bde385a30a43887dca1b5854ccf..a6a149764dbeec1fefb757b1f5e6c1dfff831c51 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -35,6 +35,11 @@ void IDEA_ofb64_encrypt(const unsigned char *in, unsigned char *out,
     unsigned char *iv;
     int save = 0;
 
+    if (n < 0) {
+        *num = -1;
+        return;
+    }
+
     iv = (unsigned char *)ivec;
     n2l(iv, v0);
     n2l(iv, v1);