This doesn't fix the real problem. The error message is saying that
there is no string terminating '\0' byte getting set after the "N/A"
string, meaning that there could be garbage in the buffer after the
string that could allow for surprising and bad things to happen when
that string is used later, including buffer overruns that can cause
stack smash or other memory munging.
Better would be to use strlcpy() with a limiter of
sizeof(adapter->fw_version).
sln
This doesn't fix the real problem. The error message is saying that
there is no string terminating '\0' byte getting set after the "N/A"
string, meaning that there could be garbage in the buffer after the
string that could allow for surprising and bad things to happen when
that string is used later, including buffer overruns that can cause
stack smash or other memory munging.
Better would be to use strlcpy() with a limiter of
sizeof(adapter->fw_version).
sln
Thanks for the tip. I looked up both strscpy and strlcpy. It seems nowadays
strscpy is preferred.
This doesn't fix the real problem. The error message is saying that
there is no string terminating '\0' byte getting set after the "N/A"
string, meaning that there could be garbage in the buffer after the
string that could allow for surprising and bad things to happen when
that string is used later, including buffer overruns that can cause
stack smash or other memory munging.
Better would be to use strlcpy() with a limiter of
sizeof(adapter->fw_version).
sln
Thanks for the tip. I looked up both strscpy and strlcpy. It seems nowadays
strscpy is preferred.