This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master in repository gfs2-utils.
The following commit(s) were added to refs/heads/master by this push: new e83a686 mkfs.gfs2: Use strncpy to copy lockproto/table into sb e83a686 is described below
commit e83a686bd6a14f55ed7f6347087890736adf6876 Author: Andrew Price anprice@redhat.com AuthorDate: Wed Jul 31 18:43:18 2019 +0100
mkfs.gfs2: Use strncpy to copy lockproto/table into sb
Commit d9a32a2d4 switched to using memcpy to fix up a compiler warning, which was spurious and no longer occurs. Switch back to strncpy as it gives better protection from copying uninitialised memory from the optarg.
Signed-off-by: Andrew Price anprice@redhat.com --- gfs2/mkfs/main_mkfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c index 7aeae69..846b341 100644 --- a/gfs2/mkfs/main_mkfs.c +++ b/gfs2/mkfs/main_mkfs.c @@ -1143,8 +1143,8 @@ int main(int argc, char *argv[]) build_root(&sbd); sb.sb_root_dir = sbd.md.rooti->i_di.di_num;
- memcpy(sb.sb_lockproto, opts.lockproto, GFS2_LOCKNAME_LEN); - memcpy(sb.sb_locktable, opts.locktable, GFS2_LOCKNAME_LEN); + strncpy(sb.sb_lockproto, opts.lockproto, GFS2_LOCKNAME_LEN); + strncpy(sb.sb_locktable, opts.locktable, GFS2_LOCKNAME_LEN); sb.sb_lockproto[GFS2_LOCKNAME_LEN - 1] = '\0'; sb.sb_locktable[GFS2_LOCKNAME_LEN - 1] = '\0';
cluster-commits@lists.stg.fedorahosted.org