master - libdm: check for size when opening control node
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2c2819763083d3c2e6b011117d8fa27c77a4d4e8 Commit: 2c2819763083d3c2e6b011117d8fa27c77a4d4e8 Parent: 583fbdba84afae3a045915603c6c057c76fcf485 Author: Zdenek Kabelac <[email protected]> AuthorDate: Fri Apr 4 21:46:45 2014 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Apr 8 11:00:13 2014 +0200
libdm: check for size when opening control node
Use dm_snprintf() to detect fail if open_control node would not have fit into buffer.
--- WHATS_NEW_DM | 1 + libdm/ioctl/libdm-iface.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletions(-)
WHATS_NEW_DM +1 -0
@@ -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.
libdm/ioctl/libdm-iface.c +2 -1
@@ -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.