In nodemap_fileset_seq_write(), it is necessary to allocate count+1
for nm_fileset in order to have a '0' at the end of the string got
with copy_from_user().
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Id170e51648a8483c8d343d9f99f115bc04f798b3
Reviewed-on: https://review.whamcloud.com/26335
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
if (count > PATH_MAX)
RETURN(-EINVAL);
if (count > PATH_MAX)
RETURN(-EINVAL);
- OBD_ALLOC(nm_fileset, count);
+ OBD_ALLOC(nm_fileset, count + 1);
+ /* OBD_ALLOC zero-fills the buffer */
if (nm_fileset == NULL)
RETURN(-ENOMEM);
if (nm_fileset == NULL)
RETURN(-ENOMEM);
- OBD_FREE(nm_fileset, count);
+ OBD_FREE(nm_fileset, count + 1);