diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-10 15:19:14 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-11 20:32:17 +0300 |
commit | c0decac19da3906d9b66291e57b7759489e1170f (patch) | |
tree | 0eeb1f7d2c5464e0c87e0c788fd8fb581662c621 /drivers/media/dvb-core | |
parent | b730c40813a95ebc35757790a990794f55e2b61c (diff) | |
download | linux-c0decac19da3906d9b66291e57b7759489e1170f.tar.xz |
media: use strscpy() instead of strlcpy()
The implementation of strscpy() is more robust and safer.
That's now the recommended way to copy NUL terminated strings.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/dvb-core')
-rw-r--r-- | drivers/media/dvb-core/dvb_vb2.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb-core/dvbdev.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/dvb-core/dvb_vb2.c b/drivers/media/dvb-core/dvb_vb2.c index b811adf88afa..c90b1fd94735 100644 --- a/drivers/media/dvb-core/dvb_vb2.c +++ b/drivers/media/dvb-core/dvb_vb2.c @@ -194,7 +194,7 @@ int dvb_vb2_init(struct dvb_vb2_ctx *ctx, const char *name, int nonblocking) spin_lock_init(&ctx->slock); INIT_LIST_HEAD(&ctx->dvb_q); - strlcpy(ctx->name, name, DVB_VB2_NAME_MAX); + strscpy(ctx->name, name, DVB_VB2_NAME_MAX); ctx->nonblocking = nonblocking; ctx->state = DVB_VB2_STATE_INIT; diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c index 3c8778570331..9a5eed3f6cf6 100644 --- a/drivers/media/dvb-core/dvbdev.c +++ b/drivers/media/dvb-core/dvbdev.c @@ -967,9 +967,9 @@ struct i2c_client *dvb_module_probe(const char *module_name, return NULL; if (name) - strlcpy(board_info->type, name, I2C_NAME_SIZE); + strscpy(board_info->type, name, I2C_NAME_SIZE); else - strlcpy(board_info->type, module_name, I2C_NAME_SIZE); + strscpy(board_info->type, module_name, I2C_NAME_SIZE); board_info->addr = addr; board_info->platform_data = platform_data; |