From 4863209a07181c36389bdfd94aecf1b4f086b242 Mon Sep 17 00:00:00 2001 From: Nate Bargmann Date: Sat, 7 Jan 2012 21:55:37 -0600 Subject: [PATCH] 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. --- winradio/winradio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winradio/winradio.c b/winradio/winradio.c index 37f29a64f..097fb1706 100644 --- a/winradio/winradio.c +++ b/winradio/winradio.c @@ -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; }