forked from enlightenment/efl
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:
parent
826998c15e
commit
49716a9cf0
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue