kopia lustrzana https://github.com/Hamlib/Hamlib
Assure NULL terminated strings in tuner files.
Various strncpy operations could result in a port pathname that is not a NULL terminated string as the allowed string length is the same size as the buffer per the strncpy manual page. This is corrected by assuring that the allowed length is FILPATHLEN - 1.Hamlib-1.2.15
rodzic
ccbfdc42e1
commit
0c525a64e2
|
@ -157,7 +157,7 @@ const struct rig_caps v4l_caps = {
|
|||
int v4l_init(RIG *rig)
|
||||
{
|
||||
rig->state.rigport.type.rig = RIG_PORT_DEVICE;
|
||||
strncpy(rig->state.rigport.pathname, DEFAULT_V4L_PATH, FILPATHLEN);
|
||||
strncpy(rig->state.rigport.pathname, DEFAULT_V4L_PATH, FILPATHLEN - 1);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ const struct rig_caps v4l2_caps = {
|
|||
int v4l2_init(RIG *rig)
|
||||
{
|
||||
rig->state.rigport.type.rig = RIG_PORT_DEVICE;
|
||||
strncpy(rig->state.rigport.pathname, DEFAULT_V4L2_PATH, FILPATHLEN);
|
||||
strncpy(rig->state.rigport.pathname, DEFAULT_V4L2_PATH, FILPATHLEN - 1);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue