While analyzing the source code while eliminating compile time
warnings I noticed there is a possible buffer overrun while parsing
the ipmievd command line arguments.
The compile time warnings flagged the direct use of 'argv' in the
strncpy function call. That same line uses an unbounded strlen()
function call to read the argv array. It is possible for a well
crafted pidfile parameter to cause unexpected behavior.
The code change here eliminates a compiler warning about using argv
directly in the strncpy function call.
It also removes the buffer overrun by only reading the same number of
characters as can be stored in the pidfile array.
It also removes a compile time warning about using a -C2X level
structure initialization feature (i.e. recv = {}).
Signed-off-by: Johnathan Mantey johnathanx.mantey@intel.com