From b6709a3a0936e7dfa9192cf6cd73b40d562fc7f8 Mon Sep 17 00:00:00 2001 From: Giovanni Bussi Date: Fri, 18 Oct 2024 14:44:21 +0200 Subject: [PATCH] Fixed possibly uninitialized variable See #1143 This variable is uninizialized if one passes SELECTOR but not SELECTOR_ID. With this fix, SELECTOR_ID has a default value (0). --- src/bias/PBMetaD.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bias/PBMetaD.cpp b/src/bias/PBMetaD.cpp index cafe7533e1..8251a350d2 100644 --- a/src/bias/PBMetaD.cpp +++ b/src/bias/PBMetaD.cpp @@ -639,6 +639,7 @@ PBMetaD::PBMetaD(const ActionOptions& ao): parse("SELECTOR", selector_); if(selector_.length()>0) { do_select_ = true; + select_value_ = 0; // set defalt value or it might be not initialized if the user does not pass SELECTOR_ID parse("SELECTOR_ID", select_value_); }