summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog/lib/src/gf-changelog.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/changelog/lib/src/gf-changelog.c')
-rw-r--r--xlators/features/changelog/lib/src/gf-changelog.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/features/changelog/lib/src/gf-changelog.c b/xlators/features/changelog/lib/src/gf-changelog.c
index 6ad6c63740d..8198560e736 100644
--- a/xlators/features/changelog/lib/src/gf-changelog.c
+++ b/xlators/features/changelog/lib/src/gf-changelog.c
@@ -374,8 +374,9 @@ gf_setup_brick_connection (xlator_t *this,
entry->connstate = GF_CHANGELOG_CONN_STATE_PENDING;
entry->notify = brick->filter;
- (void) strncpy (entry->brick, brick->brick_path, PATH_MAX-1);
- entry->brick[PATH_MAX-1] = 0;
+ if (snprintf (entry->brick, PATH_MAX, "%s", brick->brick_path)
+ >= PATH_MAX)
+ goto free_entry;
entry->this = this;
entry->invokerxl = xl;