1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-23 02:05:07 +03:00

Make sure namelen fits into buffer allocated on stack

This commit is contained in:
Zdenek Kabelac 2012-03-23 09:43:44 +00:00
parent 0237724e17
commit 4687bd1015

View File

@ -2323,6 +2323,9 @@ static if_type_t get_cluster_type(void)
if (result != CS_OK)
goto out;
if (namelen >= sizeof(buf))
namelen = sizeof(buf) - 1;
buf[namelen] = '\0';
type = parse_cluster_interface(buf);
DEBUGLOG("got interface type '%s' from confdb\n", buf);