Fix DES_LONG breakage
[openssl.git] / crypto / des / enc_writ.c
index 55cc7fcb41011865748f9145e73aebee25b8bec1..0fbef13fcccd156a2d657bb6ab7b85234aaf6583 100644 (file)
@@ -59,7 +59,7 @@
 #include <errno.h>
 #include <time.h>
 #include <stdio.h>
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
 #include "des_locl.h"
 #include <openssl/rand.h>
 
@@ -96,6 +96,9 @@ int DES_enc_write(int fd, const void *_buf, int len,
     const unsigned char *cp;
     static int start = 1;
 
+    if (len < 0)
+        return -1;
+
     if (outbuf == NULL) {
         outbuf = OPENSSL_malloc(BSIZE + HDRSIZE);
         if (outbuf == NULL)