COVERITY 13: prevent buffer overrun in quorum-tool.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2546 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Angus Salkeld 2009-11-22 06:34:11 +00:00
parent 870e4549df
commit 28f7c1e51f

View File

@ -113,6 +113,9 @@ static const char *get_quorum_type(void)
if (result != CS_OK)
goto out;
if (namelen >= sizeof(buf)) {
namelen = sizeof(buf) - 1;
}
buf[namelen] = '\0';
/* If strdup returns NULL then we just assume no quorum provider ?? */