提交 3892b957 编写于 作者: K Kurt Roeckx

Avoid creating an illegal pointer

Found by tis-interpreter
Reviewed-by: NRich Salz <rsalz@openssl.org>

GH: #1164
上级 5000a6d1
......@@ -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--;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册