aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAna María Martínez Gómez <ammartinez@suse.de>2018-06-23 00:01:17 +0200
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>2018-06-24 15:42:28 +0200
commitf223e8fd1c89d0e47e2acafe14d7f3a4e8a05742 (patch)
tree8ad1320043fc84f2dcd507e292ff5fcf8ac8a0bd /apps
parenteaf39a9fe6f55feb5251e235069e02f7f50d9a49 (diff)
downloadopenssl-f223e8fd1c89d0e47e2acafe14d7f3a4e8a05742.zip
openssl-f223e8fd1c89d0e47e2acafe14d7f3a4e8a05742.tar.gz
openssl-f223e8fd1c89d0e47e2acafe14d7f3a4e8a05742.tar.bz2
Support directories with "." in x509_load_serial()
Use `strrchr` to get a pointer to the last occurrence of `.` in the path string, instead of the first one with `strchr`. This prevent the path to be wrongly split if it contains several `.`, and not only the one for the extension. Fixes https://github.com/openssl/openssl/issues/6489. CLA: trivial Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/6566)
Diffstat (limited to 'apps')
-rw-r--r--apps/x509.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/x509.c b/apps/x509.c
index 1136642..d40960c 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -916,7 +916,7 @@ static ASN1_INTEGER *x509_load_serial(const char *CAfile,
BIGNUM *serial = NULL;
if (serialfile == NULL) {
- const char *p = strchr(CAfile, '.');
+ const char *p = strrchr(CAfile, '.');
size_t len = p != NULL ? (size_t)(p - CAfile) : strlen(CAfile);
buf = app_malloc(len + sizeof(POSTFIX), "serial# buffer");