This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new a08ece9b05 Initialize uninitialized pointer and scalar members in QUIC
and tscpp classes (#13023)
a08ece9b05 is described below
commit a08ece9b05348c5c2094915c97b1492b585687e3
Author: Bryan Call <[email protected]>
AuthorDate: Wed Mar 25 18:10:46 2026 -0700
Initialize uninitialized pointer and scalar members in QUIC and tscpp
classes (#13023)
Add default member initializers for pointer, scalar, and enum members
that Coverity flagged as uninitialized:
- QUICStreamError::stream (nullptr)
- QUICSentPacketInfo: packet_number, ack_eliciting, in_flight,
sent_bytes, time_sent, type, pn_space
- QUICSentPacketInfo::FrameInfo::_generator (nullptr)
- QUICTransferProgressProviderSA::_adapter (nullptr)
- InterceptPlugin::state_ (nullptr)
- AsyncTimer::state_ (nullptr)
---
include/iocore/net/quic/QUICTransferProgressProvider.h | 2 +-
include/iocore/net/quic/QUICTypes.h | 18 +++++++++---------
include/tscpp/api/AsyncTimer.h | 2 +-
include/tscpp/api/InterceptPlugin.h | 2 +-
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/iocore/net/quic/QUICTransferProgressProvider.h
b/include/iocore/net/quic/QUICTransferProgressProvider.h
index 77f93b97c5..2b6929fa5f 100644
--- a/include/iocore/net/quic/QUICTransferProgressProvider.h
+++ b/include/iocore/net/quic/QUICTransferProgressProvider.h
@@ -54,7 +54,7 @@ public:
bool is_cancelled() const override;
private:
- QUICStreamAdapter *_adapter;
+ QUICStreamAdapter *_adapter{nullptr};
};
class QUICTransferProgressProviderVIO : public QUICTransferProgressProvider
diff --git a/include/iocore/net/quic/QUICTypes.h
b/include/iocore/net/quic/QUICTypes.h
index 7517db2f33..706e807cad 100644
--- a/include/iocore/net/quic/QUICTypes.h
+++ b/include/iocore/net/quic/QUICTypes.h
@@ -214,7 +214,7 @@ public:
QUICStreamError(const QUICStream *s, const QUICAppErrorCode error_code,
const char *error_msg = nullptr)
: QUICError(QUICErrorClass::APPLICATION,
static_cast<uint16_t>(error_code), error_msg), stream(s){};
- const QUICStream *stream;
+ const QUICStream *stream{nullptr};
};
using QUICErrorUPtr = std::unique_ptr<QUICError>;
@@ -575,20 +575,20 @@ struct QUICSentPacketInfo {
private:
QUICFrameId _id = 0;
- QUICFrameGenerator *_generator;
+ QUICFrameGenerator *_generator{nullptr};
};
// Recovery A.1.1. Sent Packet Fields
- QUICPacketNumber packet_number;
- bool ack_eliciting;
- bool in_flight;
- size_t sent_bytes;
- ink_hrtime time_sent;
+ QUICPacketNumber packet_number{0};
+ bool ack_eliciting{false};
+ bool in_flight{false};
+ size_t sent_bytes{0};
+ ink_hrtime time_sent{0};
// Additional fields
- QUICPacketType type;
+ QUICPacketType type{QUICPacketType::UNINITIALIZED};
std::vector<FrameInfo> frames;
- QUICPacketNumberSpace pn_space;
+ QUICPacketNumberSpace pn_space{QUICPacketNumberSpace::INITIAL};
// End of additional fields
};
diff --git a/include/tscpp/api/AsyncTimer.h b/include/tscpp/api/AsyncTimer.h
index 9b511c28f4..0dc100cd6f 100644
--- a/include/tscpp/api/AsyncTimer.h
+++ b/include/tscpp/api/AsyncTimer.h
@@ -86,7 +86,7 @@ public:
void cancel() override;
private:
- AsyncTimerState *state_;
+ AsyncTimerState *state_{nullptr};
};
} // namespace atscppapi
diff --git a/include/tscpp/api/InterceptPlugin.h
b/include/tscpp/api/InterceptPlugin.h
index c1d69b9b12..37f5415362 100644
--- a/include/tscpp/api/InterceptPlugin.h
+++ b/include/tscpp/api/InterceptPlugin.h
@@ -96,7 +96,7 @@ protected:
bool setOutputComplete();
private:
- State *state_;
+ State *state_{nullptr};
bool doRead();
void handleEvent(int, void *);