diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/fonts/services.cpp | 12 | ||||
-rw-r--r-- | src/modules/netlib/netlibsock.cpp | 13 | ||||
-rw-r--r-- | src/modules/netlib/netlibupnp.cpp | 3 | ||||
-rw-r--r-- | src/modules/skin/skinicons.cpp | 2 |
4 files changed, 16 insertions, 14 deletions
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp index 39805750dc..5462b2a5b3 100644 --- a/src/modules/fonts/services.cpp +++ b/src/modules/fonts/services.cpp @@ -45,8 +45,8 @@ bool ConvertFontID(FontID *fid, FontIDW *fidw) memset(fidw, 0, sizeof(FontIDW));
fidw->cbSize = sizeof(FontIDW);
- strcpy(fidw->dbSettingsGroup, fid->dbSettingsGroup);
- strcpy(fidw->prefix, fid->prefix);
+ strncpy_s(fidw->dbSettingsGroup, fid->dbSettingsGroup, _TRUNCATE);
+ strncpy_s(fidw->prefix, fid->prefix, _TRUNCATE);
fidw->flags = fid->flags;
fidw->order = fid->order;
ConvertFontSettings(&fid->deffontsettings, &fidw->deffontsettings);
@@ -68,8 +68,8 @@ bool ConvertColourID(ColourID *cid, ColourIDW *cidw) cidw->cbSize = sizeof(ColourIDW);
- strcpy(cidw->dbSettingsGroup, cid->dbSettingsGroup);
- strcpy(cidw->setting, cid->setting);
+ strncpy_s(cidw->dbSettingsGroup, cid->dbSettingsGroup, _TRUNCATE);
+ strncpy_s(cidw->setting, cid->setting, _TRUNCATE);
cidw->flags = cid->flags;
cidw->defcolour = cid->defcolour;
cidw->order = cid->order;
@@ -86,8 +86,8 @@ bool ConvertEffectID(EffectID *eid, EffectIDW *eidw) eidw->cbSize = sizeof(EffectIDW);
- strcpy(eidw->dbSettingsGroup, eid->dbSettingsGroup);
- strcpy(eidw->setting, eid->setting);
+ strncpy_s(eidw->dbSettingsGroup, eid->dbSettingsGroup, _TRUNCATE);
+ strncpy_s(eidw->setting, eid->setting, _TRUNCATE);
eidw->flags = eid->flags;
eidw->defeffect.effectIndex = eid->defeffect.effectIndex;
eidw->defeffect.baseColour = eid->defeffect.baseColour;
diff --git a/src/modules/netlib/netlibsock.cpp b/src/modules/netlib/netlibsock.cpp index 4bc3be12f4..e53e73bd89 100644 --- a/src/modules/netlib/netlibsock.cpp +++ b/src/modules/netlib/netlibsock.cpp @@ -275,11 +275,11 @@ static NETLIBIPLIST* GetMyIpv6(unsigned flags) SOCKADDR_INET_M *iaddr = (SOCKADDR_INET_M*)ai->ai_addr;
if (ai->ai_family == AF_INET ||
(ai->ai_family == AF_INET6 &&
- (!(flags & 1) || IsAddrGlobal(&iaddr->Ipv6.sin6_addr)))) {
-
- char* szIp = NetlibAddressToString(iaddr);
+ (!(flags & 1) || IsAddrGlobal(&iaddr->Ipv6.sin6_addr))))
+ {
+ char *szIp = NetlibAddressToString(iaddr);
if (szIp)
- strcpy(addr->szIp[i++], szIp);
+ strncpy_s(addr->szIp[i++], szIp, _TRUNCATE);
mir_free(szIp);
}
}
@@ -295,13 +295,14 @@ static NETLIBIPLIST* GetMyIpv4(void) PHOSTENT he = gethostbyname(hostname);
unsigned n;
- for (n = 0; he->h_addr_list[n]; ++n);
+ for (n = 0; he->h_addr_list[n]; ++n)
+ ;
NETLIBIPLIST *addr = (NETLIBIPLIST*)mir_calloc(n * 64 + 4);
addr->cbNum = n;
for (unsigned i = 0; i < n; i++)
- strcpy(addr->szIp[i], inet_ntoa(*(PIN_ADDR)he->h_addr_list[i]));
+ strncpy_s(addr->szIp[i], inet_ntoa(*(PIN_ADDR)he->h_addr_list[i]), _TRUNCATE);
return addr;
}
diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp index 4e6813b8c9..513aafaa55 100644 --- a/src/modules/netlib/netlibupnp.cpp +++ b/src/modules/netlib/netlibupnp.cpp @@ -343,7 +343,8 @@ retrycon: break;
}
}
- strcpy(szConnHost, szHost); sConnPort = sPort;
+ strncpy_s(szConnHost, szHost, _TRUNCATE);
+ sConnPort = sPort;
}
if (send(sock, szData, sz, 0) != SOCKET_ERROR) {
diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp index 6b963dc037..048322bc49 100644 --- a/src/modules/skin/skinicons.cpp +++ b/src/modules/skin/skinicons.cpp @@ -462,7 +462,7 @@ int LoadSkinIcons(void) db_free(&dbv);
}
moduleName[0] = 0;
- strcpy(iconName, "core_status_" GLOBAL_PROTO_NAME);
+ strncpy_s(iconName, "core_status_" GLOBAL_PROTO_NAME, _TRUNCATE);
convertOneProtocol(moduleName, iconName);
CreateServiceFunction(MS_SKIN_LOADICON, sttLoadSkinIcon);
|