Commit 3892b957 authored by Kurt Roeckx's avatar Kurt Roeckx
Browse files

Avoid creating an illegal pointer



Found by tis-interpreter

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>

GH: #1164
parent 5000a6d1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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--;
    }