diff options
Diffstat (limited to 'src/lib/libcrypto/x509/by_dir.c')
| -rw-r--r-- | src/lib/libcrypto/x509/by_dir.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libcrypto/x509/by_dir.c b/src/lib/libcrypto/x509/by_dir.c index ea689aed1a..37f9a48206 100644 --- a/src/lib/libcrypto/x509/by_dir.c +++ b/src/lib/libcrypto/x509/by_dir.c | |||
| @@ -189,7 +189,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) | |||
| 189 | 189 | ||
| 190 | s=dir; | 190 | s=dir; |
| 191 | p=s; | 191 | p=s; |
| 192 | for (;;) | 192 | for (;;p++) |
| 193 | { | 193 | { |
| 194 | if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) | 194 | if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) |
| 195 | { | 195 | { |
| @@ -198,8 +198,11 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) | |||
| 198 | len=(int)(p-ss); | 198 | len=(int)(p-ss); |
| 199 | if (len == 0) continue; | 199 | if (len == 0) continue; |
| 200 | for (j=0; j<ctx->num_dirs; j++) | 200 | for (j=0; j<ctx->num_dirs; j++) |
| 201 | if (strncmp(ctx->dirs[j],ss,(unsigned int)len) == 0) | 201 | if (strlen(ctx->dirs[j]) == (size_t)len && |
| 202 | continue; | 202 | strncmp(ctx->dirs[j],ss,(unsigned int)len) == 0) |
| 203 | break; | ||
| 204 | if (j<ctx->num_dirs) | ||
| 205 | continue; | ||
| 203 | if (ctx->num_dirs_alloced < (ctx->num_dirs+1)) | 206 | if (ctx->num_dirs_alloced < (ctx->num_dirs+1)) |
| 204 | { | 207 | { |
| 205 | ctx->num_dirs_alloced+=10; | 208 | ctx->num_dirs_alloced+=10; |
| @@ -231,7 +234,6 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) | |||
| 231 | ctx->num_dirs++; | 234 | ctx->num_dirs++; |
| 232 | } | 235 | } |
| 233 | if (*p == '\0') break; | 236 | if (*p == '\0') break; |
| 234 | p++; | ||
| 235 | } | 237 | } |
| 236 | return(1); | 238 | return(1); |
| 237 | } | 239 | } |
