From: Eric Bollengier Date: Thu, 7 Sep 2023 15:10:19 +0000 (+0200) Subject: win32: Fix exchange compilation X-Git-Tag: Beta-15.0.0~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1ddaf9f73a65b28343fac59ba5cd152d3ee07d3;p=thirdparty%2Fbacula.git win32: Fix exchange compilation --- diff --git a/bacula/src/win32/filed/plugins/exchange-fd.c b/bacula/src/win32/filed/plugins/exchange-fd.c index 798608a4b..efd4bbc73 100644 --- a/bacula/src/win32/filed/plugins/exchange-fd.c +++ b/bacula/src/win32/filed/plugins/exchange-fd.c @@ -23,6 +23,7 @@ */ #include "exchange-fd.h" +#undef strncpy /* Pointers to Bacula functions */ bFuncs *bfuncs = NULL; @@ -305,7 +306,7 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) { _DebugMessage(0, "backup command=%s\n", (char *)value); char *command = new char[strlen((char *)value) + 1]; - strcpy(command, (char *)value); + bstrncpy(command, (char *)value, strlen((char *)value)+1); char *plugin_name = strtok((char *)command, ":"); char *path = strtok(NULL, ":"); char *option; @@ -331,7 +332,7 @@ static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value) char *path_bit = strtok(path, "/"); for (i = 0; path_bit != NULL && i < 6; i++) { context->path_bits[i] = new char[strlen(path_bit) + 1]; - strcpy(context->path_bits[i], path_bit); + bstrncpy(context->path_bits[i], path_bit, strlen(path_bit)+1); path_bit = strtok(NULL, "/"); }