summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/features/changelog/src/changelog-helpers.c2
-rw-r--r--xlators/features/changelog/src/changelog-misc.h12
2 files changed, 7 insertions, 7 deletions
diff --git a/xlators/features/changelog/src/changelog-helpers.c b/xlators/features/changelog/src/changelog-helpers.c
index 0a29969194e..8dae5efa454 100644
--- a/xlators/features/changelog/src/changelog-helpers.c
+++ b/xlators/features/changelog/src/changelog-helpers.c
@@ -313,7 +313,7 @@ htime_update (xlator_t *this,
ret = -1;
goto out;
}
- strcpy (changelog_path, buffer);
+ strncpy (changelog_path, buffer, PATH_MAX);
len = strlen (changelog_path);
changelog_path[len] = '\0'; /* redundant */
diff --git a/xlators/features/changelog/src/changelog-misc.h b/xlators/features/changelog/src/changelog-misc.h
index 6658552ecf1..acec6f675ac 100644
--- a/xlators/features/changelog/src/changelog-misc.h
+++ b/xlators/features/changelog/src/changelog-misc.h
@@ -83,14 +83,14 @@
} \
} while (0)
-#define CHANGELOG_FILL_HTIME_DIR(changelog_dir, path) do { \
- strcpy (path, changelog_dir); \
- strcat (path, "/htime"); \
+#define CHANGELOG_FILL_HTIME_DIR(changelog_dir, path) do { \
+ strncpy (path, changelog_dir, sizeof (path) - 1); \
+ strcat (path, "/htime"); \
} while(0)
-#define CHANGELOG_FILL_CSNAP_DIR(changelog_dir, path) do { \
- strcpy (path, changelog_dir); \
- strcat (path, "/csnap"); \
+#define CHANGELOG_FILL_CSNAP_DIR(changelog_dir, path) do { \
+ strncpy (path, changelog_dir, sizeof (path) - 1); \
+ strcat (path, "/csnap"); \
} while(0)
/**
* everything after 'CHANGELOG_TYPE_ENTRY' are internal types