[PATCH 1/4] cert: Fix logic in cert_parse_asn1_time check
Andrew Zaborowski <[email protected]>
| Newsgroups | dev.linux.lists.ell |
|---|---|
| Message-ID | <[email protected]> |
Fix wrong operator in a condition that ended up being always true. --- ell/cert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ell/cert.c b/ell/cert.c index b4f5df7..ab469c2 100644 --- a/ell/cert.c +++ b/ell/cert.c @@ -236,7 +236,7 @@ static uint64_t cert_parse_asn1_time(const uint8_t *data, size_t len, return L_TIME_INVALID; if (unlikely((len != i + 1 || data[i] != 'Z') && - (len != i + 5 || data[i] != '+' || data[i] != '-'))) + (len != i + 5 || (data[i] != '+' && data[i] != '-')))) return L_TIME_INVALID; tm.tm_year = (data[0] - '0') * 10 + (data[1] - '0'); -- 2.34.1