diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2015-02-06 12:55:06 +0100 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2015-02-06 13:38:33 +0100 |
commit | 7392fd54378f7517ddb049dfa8725c4999669310 (patch) | |
tree | 33a97f7df205049f05819674df22c1f64209a0d8 /vdagent | |
parent | 59b2fd40eb3b248f88f972a6403d3f77bf4b5c0e (diff) |
We currently have macros silently replacing use of strncpy/strcat with
strcpy_s/strcat_s when using MSVC++. However, these macros can have
unexpected effects as they use sizeof to find out the maximum size of
the destination string. This is a very significant behaviour from
strncpy/strcat, which can lead to subtle bugs as the behaviour is
different between mingw and MSVC++.
Now that we have our implementation of strcpy_s/strcat_s, we don't need
these #defines.
Diffstat (limited to 'vdagent')
-rw-r--r-- | vdagent/file_xfer.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vdagent/file_xfer.h b/vdagent/file_xfer.h index 7f756e3..7ac911e 100644 --- a/vdagent/file_xfer.h +++ b/vdagent/file_xfer.h @@ -27,7 +27,7 @@ typedef struct ALIGN_VC FileXferTask { // FIXME: should raise an error if name is too long.. // currently the only user is FileXfer::handle_start // which verifies that strlen(_name) < MAX_PATH - vdagent_strncpy_s(name, sizeof(name), _name); + vdagent_strcpy_s(name, sizeof(name), _name); } HANDLE handle; uint64_t size; |