diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-08-07 14:55:14 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-08-07 18:00:47 +0100 |
commit | eb8d96fe7f6379e72c1c5cf945511cc3e3b2f152 (patch) | |
tree | 568069ab69ce90cee2a07006415249bba1a8ac86 | |
parent | coverity#706150 Copy into fixed size buffer (diff) | |
download | core-eb8d96fe7f6379e72c1c5cf945511cc3e3b2f152.tar.gz core-eb8d96fe7f6379e72c1c5cf945511cc3e3b2f152.zip |
coverity#706155 Copy into fixed size buffer
Change-Id: Ib795dc1b64d908942a836d09bfcde9f19d318b1b
-rw-r--r-- | sal/osl/unx/socket.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c index 000e2e03cd8a..2bbe95a093fa 100644 --- a/sal/osl/unx/socket.c +++ b/sal/osl/unx/socket.c @@ -1073,7 +1073,8 @@ oslSocketResult SAL_CALL osl_psz_getLocalHostname ( if ((pStr = osl_psz_getHostnameOfHostAddr(Addr)) != NULL) { - strcpy(LocalHostname, pStr); + strncpy(LocalHostname, pStr, sizeof( LocalHostname )); + LocalHostname[sizeof(LocalHostname)-1] = 0; } osl_destroyHostAddr(Addr); } |