Make sure we handle input NULL with length 0
[openssl.git] / providers / implementations / ciphers / cipher_tdes_wrap.c
index d899985202b5d85f2c730ee6bcde565a17e32da3..fc49696fbd3f5b8bbcd081364c4991fd0074ee9a 100644 (file)
@@ -145,6 +145,8 @@ static int tdes_wrap_update(void *vctx, unsigned char *out, size_t *outl,
                             size_t inl)
 {
     *outl = 0;
+    if (inl == 0)
+        return 1;
     if (outsize < inl) {
         PROVerr(0, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
         return 0;