mirror of
https://github.com/Hamlib/Hamlib.git
synced 2024-09-23 11:27:25 +00:00
Assure NULL terminated strings in kit file.
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.
This commit is contained in:
parent
4863209a07
commit
db3afff112
@ -269,7 +269,7 @@ int hiqsdr_init(RIG *rig)
|
||||
priv->split = RIG_SPLIT_OFF;
|
||||
priv->ref_clock = REFCLOCK;
|
||||
priv->sample_rate = DEFAULT_SAMPLE_RATE;
|
||||
strncpy(rig->state.rigport.pathname, "192.168.2.196:48248", FILPATHLEN);
|
||||
strncpy(rig->state.rigport.pathname, "192.168.2.196:48248", FILPATHLEN - 1);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user