From: tb Date: Tue, 7 Jun 2022 17:53:42 +0000 (+0000) Subject: Simplify another CBS_write_bytes() call in d2i_SSL_SESSION() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b0272491621c7a95f2a768c7fd2e244c80d2c653;p=openbsd Simplify another CBS_write_bytes() call in d2i_SSL_SESSION() ok jsing --- diff --git a/lib/libssl/ssl_asn1.c b/lib/libssl/ssl_asn1.c index d5138115e54..6095a7370c1 100644 --- a/lib/libssl/ssl_asn1.c +++ b/lib/libssl/ssl_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_asn1.c,v 1.64 2022/06/07 17:45:13 tb Exp $ */ +/* $OpenBSD: ssl_asn1.c,v 1.65 2022/06/07 17:53:42 tb Exp $ */ /* * Copyright (c) 2016 Joel Sing * @@ -348,11 +348,8 @@ d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length) goto err; if (present) { if (!CBS_write_bytes(&session_id, (uint8_t *)&s->sid_ctx, - sizeof(s->sid_ctx), &data_len)) + sizeof(s->sid_ctx), &s->sid_ctx_length)) goto err; - if (data_len > UINT_MAX) - goto err; - s->sid_ctx_length = (unsigned int)data_len; } /* Verify result [5]. */