Skip to content

Commit 9b20a34

Browse files
committed
[ssl cert] fixes the ci compilation error.
[error]:: /root/parts/multipass/src/src/cert/ssl_cert_provider.cpp:136:54: error: ‘serial_bytes’ may be used uninitialized [-Werror=maybe-uninitialized]
1 parent c26c20c commit 9b20a34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cert/ssl_cert_provider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ std::vector<unsigned char> as_vector(const std::string& v)
132132
void set_random_serial_number(X509* cert)
133133
{
134134
// OpenSSL recommends a 20-byte (160-bit) serial number
135-
std::array<uint8_t, 20> serial_bytes;
135+
std::array<uint8_t, 20> serial_bytes{};
136136
RAND_bytes(serial_bytes.data(), serial_bytes.size());
137137
// Set the highest bit to 0 (unsigned) to ensure it's positive
138138
serial_bytes[0] &= 0x7F;

0 commit comments

Comments
 (0)