From 5b789e5ddf8ba2391ecd7443ff3e42c88d5a192c Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 31 Jul 2017 10:45:12 +0200 Subject: [PATCH] bpipe: Fix compiler warning The new GCC reports that the strncpy is incorrect. As the length was tested just before, this is not a bug fix. --- bacula/src/plugins/fd/bpipe-fd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bacula/src/plugins/fd/bpipe-fd.c b/bacula/src/plugins/fd/bpipe-fd.c index 6f1744400f..76f187580c 100644 --- a/bacula/src/plugins/fd/bpipe-fd.c +++ b/bacula/src/plugins/fd/bpipe-fd.c @@ -459,7 +459,7 @@ static bRC createFile(bpContext *ctx, struct restore_pkt *rp) if (strlen(rp->where) > 512) { printf("Restore target dir too long. Restricting to first 512 bytes.\n"); } - strncpy(((struct plugin_ctx *)ctx->pContext)->where, rp->where, 513); + strncpy(((struct plugin_ctx *)ctx->pContext)->where, rp->where, 512); ((struct plugin_ctx *)ctx->pContext)->replace = rp->replace; rp->create_status = CF_EXTRACT; return bRC_OK; -- 2.39.5