Ecore con: Prevent possible use of uninitialised buffer on the stack.

I'm not actually sure if it's a false, because finding the possible
options is hard. Just to be safe, it's better to set buf to "" in the
else case. I'm doing this instead of initialising the variable so the
compiler/static analyser will be able to warn us if there are other code
paths that should probably set buf, but don't.

CID 1316016

@fix
This commit is contained in:
Tom Hacohen 2015-10-04 16:27:52 +01:00
parent fa2ecb3af6
commit 681328feb5
1 changed files with 4 additions and 0 deletions

View File

@ -303,6 +303,10 @@ ecore_con_local_listen(
strncpy(buf, svr->name, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = 0;
}
else
{
buf[0] = '\0';
}
pmode = umask(mask);
start: