summaryrefslogtreecommitdiff
path: root/crypto/openssl/crypto/conf/conf_def.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/crypto/conf/conf_def.c')
-rw-r--r--crypto/openssl/crypto/conf/conf_def.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/crypto/openssl/crypto/conf/conf_def.c b/crypto/openssl/crypto/conf/conf_def.c
index 8e3f42a0caca2..ca76fa3679b8a 100644
--- a/crypto/openssl/crypto/conf/conf_def.c
+++ b/crypto/openssl/crypto/conf/conf_def.c
@@ -703,7 +703,9 @@ static BIO *process_include(char *include, OPENSSL_DIR_CTX **dirctx,
static BIO *get_next_file(const char *path, OPENSSL_DIR_CTX **dirctx)
{
const char *filename;
+ size_t pathlen;
+ pathlen = strlen(path);
while ((filename = OPENSSL_DIR_read(dirctx, path)) != NULL) {
size_t namelen;
@@ -716,7 +718,7 @@ static BIO *get_next_file(const char *path, OPENSSL_DIR_CTX **dirctx)
char *newpath;
BIO *bio;
- newlen = strlen(path) + namelen + 2;
+ newlen = pathlen + namelen + 2;
newpath = OPENSSL_zalloc(newlen);
if (newpath == NULL) {
CONFerr(CONF_F_GET_NEXT_FILE, ERR_R_MALLOC_FAILURE);
@@ -727,14 +729,11 @@ static BIO *get_next_file(const char *path, OPENSSL_DIR_CTX **dirctx)
* If the given path isn't clear VMS syntax,
* we treat it as on Unix.
*/
- {
- size_t pathlen = strlen(path);
-
- if (path[pathlen - 1] == ']' || path[pathlen - 1] == '>'
- || path[pathlen - 1] == ':') {
- /* Clear VMS directory syntax, just copy as is */
- OPENSSL_strlcpy(newpath, path, newlen);
- }
+ if (path[pathlen - 1] == ']'
+ || path[pathlen - 1] == '>'
+ || path[pathlen - 1] == ':') {
+ /* Clear VMS directory syntax, just copy as is */
+ OPENSSL_strlcpy(newpath, path, newlen);
}
#endif
if (newpath[0] == '\0') {