diff options
author | Adam Langley <agl@chromium.org> | 2014-06-20 23:00:00 +0400 |
---|---|---|
committer | Adam Langley <agl@chromium.org> | 2014-06-21 00:17:38 +0400 |
commit | c83b1ceae2dbde83310a355123485c98f14cd01f (patch) | |
tree | 4fa235c55e99f67e997c561dffe6b56c395ce139 /crypto/x509 | |
parent | f669c2d91a59aadfc90235f036231195bef9c5a7 (diff) |
x509/by_dir.c: fix run-away pointer.
fix run-away pointer (and potential SEGV) when adding duplicates in
add_cert_dir.
PR: 3261
Reported by: Marian Done
(Imported from upstream's 83fe7b9c8321d5ffb6bfe67df85ed66ceb97102f)
Diffstat (limited to 'crypto/x509')
-rw-r--r-- | crypto/x509/by_dir.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c index 8b8d0d46..23877925 100644 --- a/crypto/x509/by_dir.c +++ b/crypto/x509/by_dir.c @@ -210,7 +210,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) s=dir; p=s; - for (;;p++) + do { if ((*p == ':') || (*p == '\0')) { @@ -256,9 +256,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) return 0; } } - if (*p == '\0') - break; - } + } while (*p++ != '\0'); return 1; } |