summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2016-06-10 16:33:04 +0530
committerDan Lambright <dlambrig@redhat.com>2016-06-14 06:51:11 -0700
commit45ae064a03e9d7864316723d7c258698f03dbc52 (patch)
tree1c98e291e540aacc73002d8099cfbcfd0cea8ce6 /xlators
parent0eddfc43be1939f4fe892cd09c7356091b243b3a (diff)
tiering/ctr: Fix strcpy coverity
Backport of http://review.gluster.org/#/c/14696/ Change-Id: I6cffba3e09a023f105dbf2975cc9a3ae1a965c31 BUG: 1346132 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/14696 Reviewed-by: mohammed rafi kc <rkavunga@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: N Balachandran <nbalacha@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> (cherry picked from commit 3474aa85e399a92d3ee9159a2d066d4bd73611a0) Reviewed-on: http://review.gluster.org/14720 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/changetimerecorder/src/changetimerecorder.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/features/changetimerecorder/src/changetimerecorder.c b/xlators/features/changetimerecorder/src/changetimerecorder.c
index 47de911d200..0631d5e6c73 100644
--- a/xlators/features/changetimerecorder/src/changetimerecorder.c
+++ b/xlators/features/changetimerecorder/src/changetimerecorder.c
@@ -125,8 +125,9 @@ ctr_lookup_wind(call_frame_t *frame,
/* Copy hard link info*/
gf_uuid_copy (CTR_DB_REC(ctr_local).pargfid,
*((NEW_LINK_CX(ctr_inode_cx))->pargfid));
- strcpy (CTR_DB_REC(ctr_local).file_name,
- NEW_LINK_CX(ctr_inode_cx)->basename);
+ strncpy (CTR_DB_REC(ctr_local).file_name,
+ NEW_LINK_CX(ctr_inode_cx)->basename,
+ sizeof(CTR_DB_REC(ctr_local).file_name));
/* Since we are in lookup we can ignore errors while
* Inserting in the DB, because there may be many