Avoid undefined behavior in tlsexttest
authortb <tb@openbsd.org>
Wed, 5 Jul 2023 17:30:14 +0000 (17:30 +0000)
committertb <tb@openbsd.org>
Wed, 5 Jul 2023 17:30:14 +0000 (17:30 +0000)
commit1964a63a33254fd27b37b5f191d078dccb4f0c6d
tree3907b55ec0dccc875118fab6ec9e01dd6c12e09b
parent1c55417ba1e3ce6f9c9d14c9f34b35fa70d532a8
Avoid undefined behavior in tlsexttest

An empty array cannot be initialized and it is an incomplete type, so the
sizeof() operator can't be applied to it. Therefore initialize it with a
zero byte and replace sizeof() use with lengths.

Slightly tweaked version of a patch by inoguchi in portable.
Discussed with bcook, beck, kettenis
regress/lib/libssl/tlsext/tlsexttest.c