From: Eric Bollengier Date: Mon, 31 Jul 2017 08:45:12 +0000 (+0200) Subject: bpipe: Fix compiler warning X-Git-Tag: Release-9.0.3~9 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5b789e5ddf8ba2391ecd7443ff3e42c88d5a192c;p=bacula%2Fbacula 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. --- 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;