[PATCH] Explicitly initialize m_v_n and m_v_b

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

msuraev at sysmocom.de msuraev at sysmocom.de
Wed Feb 24 16:40:18 UTC 2016


From: Max <msuraev at sysmocom.de>

Call reset() to initialize m_v_b in gprs_rlc_dl_window() and
m_v_n in gprs_rlc_ul_window() constructors.

Fixes: Coverity: CID 1351738, 1351737
---
 src/rlc.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/rlc.h b/src/rlc.h
index 54f28df..c3c03e0 100644
--- a/src/rlc.h
+++ b/src/rlc.h
@@ -448,6 +448,7 @@ inline gprs_rlc_dl_window::gprs_rlc_dl_window()
 	: m_v_s(0)
 	, m_v_a(0)
 {
+	m_v_b.reset();
 }
 
 inline const uint16_t gprs_rlc_dl_window::v_s() const
@@ -494,6 +495,7 @@ inline gprs_rlc_ul_window::gprs_rlc_ul_window()
 	: m_v_r(0)
 	, m_v_q(0)
 {
+	m_v_n.reset();
 }
 
 inline bool gprs_rlc_ul_window::is_in_window(uint16_t bsn) const
-- 
2.7.1




More information about the OpenBSC mailing list