summaryrefslogtreecommitdiff
path: root/drivers/media/dvb-core
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-29 15:53:30 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-29 15:53:30 +0300
commite73f9f68799400b6cb4087115e279d290437990f (patch)
tree1e2949d0eae2c58dc561de6743970ded9797bc97 /drivers/media/dvb-core
parenteb0f73ba12305842153758fdee2a75776724a528 (diff)
downloadlinux-e73f9f68799400b6cb4087115e279d290437990f.tar.xz
media: dvb_vb2: use strlcpy instead of strncpy
Instead of using strncpy(), use strlcpy(), in order to ensure that a \0 char will be added at the end of the string. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/dvb-core')
-rw-r--r--drivers/media/dvb-core/dvb_vb2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/dvb-core/dvb_vb2.c b/drivers/media/dvb-core/dvb_vb2.c
index 61c6ca4e87d5..889abf9becd8 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);
- strncpy(ctx->name, name, DVB_VB2_NAME_MAX);
+ strlcpy(ctx->name, name, DVB_VB2_NAME_MAX);
ctx->nonblocking = nonblocking;
ctx->state = DVB_VB2_STATE_INIT;