ecore_con: replacing strncat with strncpy.

Summary:
strcat will look for the null-terminator, interpret that as the end of the string, and append the new text there, overwriting the null-terminator in the process, and writing a new null-terminator at the end of the concatenation. buf is uninitialized, so it might start with NULL, or it might not have NULL anywhere within it. So this might produce undefined behaviour. So replaced with strncpy.
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3094

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Srivardhan Hebbar 2015-09-23 14:04:23 -07:00 committed by Cedric BAIL
parent 826998c15e
commit 49716a9cf0
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ _gnutls_log_func(int level,
const char *str)
{
char buf[128];
strncat(buf, str, strlen(str) - 1);
strncpy(buf, str, strlen(str) - 1);
DBG("|<%d>| %s", level, buf);
}