Avoid signed vs unsigned comparison error.
authorPauli <paul.dale@oracle.com>
Thu, 14 Sep 2017 23:05:43 +0000 (09:05 +1000)
committerPauli <paul.dale@oracle.com>
Thu, 14 Sep 2017 23:05:43 +0000 (09:05 +1000)
Introduced by #4372

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4374)

crypto/x509/by_dir.c

index 03492acb0f52fa12b2101e5fbf0348fc51b8f527..b83a473017341f2dc07576044195aeb9e1779ada 100644 (file)
@@ -150,7 +150,8 @@ static void free_dir(X509_LOOKUP *lu)
 
 static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
 {
-    int j, len;
+    int j;
+    size_t len;
     const char *s, *ss, *p;
 
     if (dir == NULL || !*dir) {
@@ -165,7 +166,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
             BY_DIR_ENTRY *ent;
             ss = s;
             s = p + 1;
-            len = (int)(p - ss);
+            len = p - ss;
             if (len == 0)
                 continue;
             for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {