Zero-initialize struct which contains kernel structs.
This one struct initialization results in two uninitialized
xfrm_address_t objects. Those objects are then filled in with correctly
initialized values. There is no bug here, but we should maintain struct
hygiene.
Bug: 65693875
Test: runtest -x system/netd/server/netd_unit_test.cpp
Change-Id: Ie61971f0965ce7054d5194ac8ca7991eee214a3e
diff --git a/server/XfrmController.cpp b/server/XfrmController.cpp
index ff07c49..ddfda5a 100644
--- a/server/XfrmController.cpp
+++ b/server/XfrmController.cpp
@@ -482,7 +482,7 @@
ALOGD("remoteAddress=%s", remoteAddress.c_str());
ALOGD("spi=%0.8x", spi);
- XfrmSaId saId;
+ XfrmSaId saId{};
netdutils::Status ret = fillXfrmSaId(direction, localAddress, remoteAddress, spi, &saId);
if (!isOk(ret)) {
return ret;