mirror of https://github.com/openssl/openssl.git
Avoid creating an illegal pointer
Found by tis-interpreter Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1164
This commit is contained in:
parent
5000a6d121
commit
3892b95750
|
@ -396,10 +396,10 @@ static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in)
|
||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
|
|
||||||
to = from + len - 1;
|
to = from + len;
|
||||||
|
|
||||||
/* Ignore trailing spaces */
|
/* Ignore trailing spaces */
|
||||||
while ((len > 0) && !(*to & 0x80) && isspace(*to)) {
|
while ((len > 0) && !(to[-1] & 0x80) && isspace(to[-1])) {
|
||||||
to--;
|
to--;
|
||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue