kopia lustrzana https://github.com/Hamlib/Hamlib
Assure NULL terminated strings in winradio 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.Hamlib-1.2.15
rodzic
0c525a64e2
commit
4863209a07
|
@ -46,7 +46,7 @@
|
|||
|
||||
int wr_rig_init(RIG *rig) {
|
||||
rig->state.rigport.type.rig = RIG_PORT_DEVICE;
|
||||
strncpy(rig->state.rigport.pathname, DEFAULT_WINRADIO_PATH, FILPATHLEN);
|
||||
strncpy(rig->state.rigport.pathname, DEFAULT_WINRADIO_PATH, FILPATHLEN - 1);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue