libcom/osi: fix dangerous usage of strncat (WIN32)
(found by sonar/cppcheck)
This commit is contained in:
@@ -64,10 +64,10 @@ epicsShareFunc int epicsShareAPI osiSockAttach()
|
|||||||
DWORD titleLength = GetConsoleTitle(title, sizeof(title));
|
DWORD titleLength = GetConsoleTitle(title, sizeof(title));
|
||||||
if (titleLength) {
|
if (titleLength) {
|
||||||
titleLength = strlen (title);
|
titleLength = strlen (title);
|
||||||
strncat (title, " " EPICS_VERSION_STRING, sizeof(title));
|
strncat (title, " " EPICS_VERSION_STRING, sizeof(title)-1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
strncpy(title, EPICS_VERSION_STRING, sizeof(title));
|
strncpy(title, EPICS_VERSION_STRING, sizeof(title)-1);
|
||||||
}
|
}
|
||||||
title[sizeof(title)-1]= '\0';
|
title[sizeof(title)-1]= '\0';
|
||||||
SetConsoleTitle(title);
|
SetConsoleTitle(title);
|
||||||
|
|||||||
Reference in New Issue
Block a user