diff options
author | Kurt Roeckx <kurt@roeckx.be> | 2016-06-04 16:25:39 +0200 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2016-06-11 16:43:48 +0200 |
commit | 3892b95750b6aa5ed4328a287068f7cdfb9e55bc (patch) | |
tree | 33691a883092cc7c929fff405beac801c51f001b /crypto | |
parent | 5000a6d1215ea7d6ed6179d0bcd44263f6e3c26b (diff) | |
download | openssl-3892b95750b6aa5ed4328a287068f7cdfb9e55bc.tar.gz |
Avoid creating an illegal pointer
Found by tis-interpreter
Reviewed-by: Rich Salz <rsalz@openssl.org>
GH: #1164
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/x509/x_name.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/x509/x_name.c b/crypto/x509/x_name.c index f0b35fb4fa..5c624cbd17 100644 --- a/crypto/x509/x_name.c +++ b/crypto/x509/x_name.c @@ -396,10 +396,10 @@ static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in) len--; } - to = from + len - 1; + to = from + len; /* Ignore trailing spaces */ - while ((len > 0) && !(*to & 0x80) && isspace(*to)) { + while ((len > 0) && !(to[-1] & 0x80) && isspace(to[-1])) { to--; len--; } |