]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix bad Windows strncpy again ...
authorKern Sibbald <kern@sibbald.com>
Thu, 2 May 2019 13:58:20 +0000 (15:58 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 29 Apr 2021 08:44:19 +0000 (10:44 +0200)
bacula/src/win32/filed/plugins/bpipe-fd.c

index 6e5ea8bea14d87a537b18bb5bf8352ca0d65cb50..5e6eca38d6799098cbfd2a14e00a87ac090e0d29 100644 (file)
@@ -448,8 +448,7 @@ static bRC createFile(bpContext *ctx, struct restore_pkt *rp)
       printf("Restore where directory name too long. Restricting to first %d bytes.\n",
          (int)sizeof(plugin_ctx::where)-1);
    }
-   strncpy(((struct plugin_ctx *)ctx->pContext)->where, rp->where,
-      sizeof(plugin_ctx::where));
+   bstrncpy(((struct plugin_ctx *)ctx->pContext)->where, rp->where, sizeof(plugin_ctx::where));
    ((struct plugin_ctx *)ctx->pContext)->replace = rp->replace;
    rp->create_status = CF_EXTRACT;
    return bRC_OK;