Patchwork [BUG:1583] mgmt/glusterd: Use appropriate length while doing strncpy

login
register
Submitter Vijay Bellur
Date 2010-09-09 11:26:02
Message ID <20100909112602.GA15025@dev.gluster.com>
Download mbox | patch
Permalink /patch/4711/
State Accepted
Headers show

Comments

Vijay Bellur - 2010-09-09 11:26:02
Signed-off-by: Vijay Bellur <vijay@gluster.com>
---
 xlators/mgmt/glusterd/src/glusterd-op-sm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index db3305c..19bc73e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1052,7 +1052,7 @@  glusterd_op_create_volume (gd1_mgmt_stage_op_req *req)
                 goto out;
         }
 
-        strncpy (volinfo->volname, volname, 1024);
+        strncpy (volinfo->volname, volname, GLUSTERD_MAX_VOLUME_NAME);
         GF_ASSERT (volinfo->volname);
 
         ret = dict_get_int32 (dict, "type", &volinfo->type);