Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Coverity issues in contrail-controller/agent_param.cc
I have run Coverity on branch R5.0 and it reported the following issues in contrail-controller/agent_param.cc: - buffer_size_warning: Calling strncpy with a maximum size argument of 16 bytes on destination array ifrn.ifrn_name of size 16 bytes might leave the destination string unterminated in agent_param.cc:ValidateInterface - leaked_storage: Variable f going out of scope leaks the storage it points to in agent_param.cc:ValidateInterface Indeed, for the 1st issue, the length of std::string::c_str() may be greater than IF_NAMESIZE. In that case, after calling strncpy, ifrn.ifrn_name will not be a NULL-terminated string. For the 2nd issue, we need to close the file pointer before exiting the function. Change-Id: Iceaf2490ae224b7134a4781f894b784f016e42a3 Closes-bug: #1770169 Signed-off-by: Anda Nicolae <anicolae@lenovo.com>
- Loading branch information