mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
libdm: check for size when opening control node
Use dm_snprintf() to detect fail if open_control node would not have fit into buffer.
This commit is contained in:
parent
583fbdba84
commit
2c28197630
@ -1,5 +1,6 @@
|
||||
Version 1.02.85 -
|
||||
===================================
|
||||
Check for sprintf error when creating path for dm control node.
|
||||
When buffer for dm_get_library_version() is too small, return error code.
|
||||
Always reinitialize _name_mangling_mode in dm_lib_init().
|
||||
Add tracking flag about implicitly added devices into dm_tree.
|
||||
|
@ -380,7 +380,8 @@ static int _open_control(void)
|
||||
if (!_uname())
|
||||
return 0;
|
||||
|
||||
snprintf(control, sizeof(control), "%s/%s", dm_dir(), DM_CONTROL_NODE);
|
||||
if (dm_snprintf(control, sizeof(control), "%s/%s", dm_dir(), DM_CONTROL_NODE) < 0)
|
||||
goto_bad;
|
||||
|
||||
/*
|
||||
* Prior to 2.6.36 the minor number should be looked up in /proc.
|
||||
|
Loading…
Reference in New Issue
Block a user