diff options
author | Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> | 2014-07-26 16:41:46 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-27 11:39:45 -0700 |
commit | 4c86db6aac80246ff801bba3f32517d6c2200137 (patch) | |
tree | 847f3633825125c9cf779495df2d1f1be065afc4 /drivers/staging/unisys | |
parent | 645b0314524b8017978fc43769a884bc95776b5a (diff) | |
download | linux-4c86db6aac80246ff801bba3f32517d6c2200137.tar.gz linux-4c86db6aac80246ff801bba3f32517d6c2200137.tar.bz2 linux-4c86db6aac80246ff801bba3f32517d6c2200137.zip |
staging: unisys: include: uisutils.h: Cleaning up missing null-terminate in conjunction with strncpy
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys')
-rw-r--r-- | drivers/staging/unisys/include/uisutils.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/unisys/include/uisutils.h b/drivers/staging/unisys/include/uisutils.h index 70776c93cc50..14d5cbda594a 100644 --- a/drivers/staging/unisys/include/uisutils.h +++ b/drivers/staging/unisys/include/uisutils.h @@ -307,20 +307,20 @@ Issue_VMCALL_CHANNEL_MISMATCH(const char *ChannelName, U64 physaddr; char *last_slash = NULL; - strncpy(params.ChannelName, ChannelName, + strlcpy(params.ChannelName, ChannelName, lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, ChannelName)); - strncpy(params.ItemName, ItemName, + strlcpy(params.ItemName, ItemName, lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, ItemName)); params.SourceLineNumber = SourceLineNumber; last_slash = strrchr(path_n_fn, '/'); if (last_slash != NULL) { last_slash++; - strncpy(params.SourceFileName, last_slash, + strlcpy(params.SourceFileName, last_slash, lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, SourceFileName)); } else - strncpy(params.SourceFileName, + strlcpy(params.SourceFileName, "Cannot determine source filename", lengthof(VMCALL_CHANNEL_VERSION_MISMATCH_PARAMS, SourceFileName)); |