From 52bfff5756ee3c8377d96c8da884f886b96dee27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Trojnara?= Date: Wed, 4 Jun 2025 18:42:41 +0200 Subject: [PATCH] Avoid variable reuse --- osslsigncode.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/osslsigncode.c b/osslsigncode.c index ea28753..d2d6d7b 100644 --- a/osslsigncode.c +++ b/osslsigncode.c @@ -4136,7 +4136,8 @@ static ENGINE *engine_dynamic(const char *path) return NULL; /* FAILED */ } if (path) { /* strip directory and extension */ - char *ptr; + const char *ptr; + char *dot; ptr = strrchr(path, '/'); if (!ptr) /* no slash -> try backslash */ @@ -4146,11 +4147,11 @@ static ENGINE *engine_dynamic(const char *path) if (!strncmp(ptr, "lib", 3)) ptr += 3; /* skip the "lib" prefix */ } else /* directory separator not found */ - ptr = (char *)path; + ptr = path; id = OPENSSL_strdup(ptr); - ptr = strchr(id, '.'); - if (ptr) /* file extensions found */ - *ptr = '\0'; /* remove them */ + dot = strchr(id, '.'); + if (dot) /* file extensions found */ + *dot = '\0'; /* remove them */ } else { id = OPENSSL_strdup("pkcs11"); }