There are hot discussions upstream about getting rid of strcpy(), strncpy() and strlcpy() in favor of the safer strscpy(). While there are exceptions where strscpy() may not be the best option (for example, when filling records with fixed size), we don't have those situations right now on media. On all cases, all the core and drivers are doing are filling some var with a name. So, we can switch all such functions by strscpy(). Mauro Carvalho Chehab (3): media: use strscpy() instead of strlcpy() media: replace strcpy() by strscpy() media: replace strncpy() by strscpy() drivers/media/cec/cec-api.c | 4 +- drivers/media/cec/cec-core.c | 2 +- drivers/media/common/b2c2/flexcop-i2c.c | 12 ++--- drivers/media/common/cx2341x.c | 2 +- drivers/media/common/saa7146/saa7146_fops.c | 2 +- drivers/media/common/saa7146/saa7146_video.c | 8 +-- drivers/media/common/siano/smscoreapi.c | 4 +- drivers/media/common/siano/smsir.c | 2 +- drivers/media/dvb-core/dvb_frontend.c | 2 +- drivers/media/dvb-core/dvb_vb2.c | 2 +- drivers/media/dvb-core/dvbdev.c | 4 +- drivers/media/dvb-frontends/as102_fe.c | 2 +- drivers/media/dvb-frontends/cx24123.c | 2 +- drivers/media/dvb-frontends/cxd2820r_core.c | 2 +- drivers/media/dvb-frontends/dib7000p.c | 3 +- drivers/media/dvb-frontends/dib8000.c | 4 +- drivers/media/dvb-frontends/dib9000.c | 6 ++- drivers/media/dvb-frontends/dibx000_common.c | 2 +- drivers/media/dvb-frontends/dvb-pll.c | 2 +- drivers/media/dvb-frontends/lgdt330x.c | 2 +- drivers/media/dvb-frontends/m88ds3103.c | 4 +- drivers/media/dvb-frontends/mt312.c | 9 ++-- drivers/media/dvb-frontends/rtl2832_sdr.c | 10 ++-- drivers/media/dvb-frontends/s5h1420.c | 2 +- drivers/media/dvb-frontends/tc90522.c | 2 +- drivers/media/dvb-frontends/ts2020.c | 2 +- drivers/media/dvb-frontends/zd1301_demod.c | 3 +- drivers/media/dvb-frontends/zl10039.c | 5 +- drivers/media/firewire/firedtv-fe.c | 2 +- drivers/media/i2c/ad5820.c | 2 +- drivers/media/i2c/cs53l32a.c | 2 +- drivers/media/i2c/imx274.c | 2 +- drivers/media/i2c/lm3560.c | 3 +- drivers/media/i2c/lm3646.c | 3 +- drivers/media/i2c/m5mols/m5mols_core.c | 2 +- drivers/media/i2c/max2175.c | 2 +- drivers/media/i2c/msp3400-driver.c | 2 +- drivers/media/i2c/noon010pc30.c | 2 +- drivers/media/i2c/ov9650.c | 2 +- drivers/media/i2c/s5c73m3/s5c73m3-core.c | 4 +- drivers/media/i2c/s5k4ecgx.c | 2 +- drivers/media/i2c/s5k6aa.c | 2 +- drivers/media/i2c/saa7115.c | 6 +-- drivers/media/i2c/saa7127.c | 4 +- drivers/media/i2c/sr030pc30.c | 2 +- drivers/media/i2c/tvaudio.c | 2 +- drivers/media/i2c/video-i2c.c | 8 +-- drivers/media/media-device.c | 28 +++++----- drivers/media/pci/bt8xx/bttv-driver.c | 10 ++-- drivers/media/pci/bt8xx/bttv-i2c.c | 6 +-- drivers/media/pci/bt8xx/bttv-input.c | 2 +- drivers/media/pci/bt8xx/dst.c | 3 +- drivers/media/pci/bt8xx/dvb-bt8xx.c | 3 +- drivers/media/pci/cobalt/cobalt-alsa-main.c | 2 +- drivers/media/pci/cobalt/cobalt-alsa-pcm.c | 4 +- drivers/media/pci/cobalt/cobalt-v4l2.c | 14 ++--- drivers/media/pci/cx18/cx18-alsa-main.c | 2 +- drivers/media/pci/cx18/cx18-alsa-pcm.c | 2 +- drivers/media/pci/cx18/cx18-cards.c | 8 +-- drivers/media/pci/cx18/cx18-driver.c | 2 +- drivers/media/pci/cx18/cx18-i2c.c | 2 +- drivers/media/pci/cx18/cx18-ioctl.c | 8 +-- drivers/media/pci/cx23885/cx23885-417.c | 8 +-- drivers/media/pci/cx23885/cx23885-alsa.c | 4 +- drivers/media/pci/cx23885/cx23885-dvb.c | 54 +++++++++---------- drivers/media/pci/cx23885/cx23885-i2c.c | 4 +- drivers/media/pci/cx23885/cx23885-ioctl.c | 4 +- drivers/media/pci/cx23885/cx23885-video.c | 15 +++--- drivers/media/pci/cx25821/cx25821-alsa.c | 8 +-- drivers/media/pci/cx25821/cx25821-i2c.c | 2 +- drivers/media/pci/cx25821/cx25821-video.c | 10 ++-- drivers/media/pci/cx88/cx88-alsa.c | 6 +-- drivers/media/pci/cx88/cx88-blackbird.c | 6 +-- drivers/media/pci/cx88/cx88-cards.c | 2 +- drivers/media/pci/cx88/cx88-i2c.c | 4 +- drivers/media/pci/cx88/cx88-input.c | 4 +- drivers/media/pci/cx88/cx88-video.c | 12 ++--- drivers/media/pci/cx88/cx88-vp3054-i2c.c | 2 +- drivers/media/pci/dm1105/dm1105.c | 5 +- drivers/media/pci/dt3155/dt3155.c | 8 +-- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 8 +-- drivers/media/pci/ivtv/ivtv-alsa-main.c | 2 +- drivers/media/pci/ivtv/ivtv-alsa-pcm.c | 2 +- drivers/media/pci/ivtv/ivtv-cards.c | 12 ++--- drivers/media/pci/ivtv/ivtv-i2c.c | 4 +- drivers/media/pci/ivtv/ivtv-ioctl.c | 8 +-- drivers/media/pci/ivtv/ivtvfb.c | 2 +- drivers/media/pci/mantis/mantis_i2c.c | 2 +- drivers/media/pci/meye/meye.c | 10 ++-- drivers/media/pci/ngene/ngene-i2c.c | 2 +- drivers/media/pci/pluto2/pluto2.c | 3 +- drivers/media/pci/pt1/pt1.c | 2 +- drivers/media/pci/pt3/pt3.c | 2 +- drivers/media/pci/saa7134/saa7134-alsa.c | 8 +-- drivers/media/pci/saa7134/saa7134-empress.c | 2 +- drivers/media/pci/saa7134/saa7134-go7007.c | 4 +- drivers/media/pci/saa7134/saa7134-i2c.c | 2 +- drivers/media/pci/saa7134/saa7134-input.c | 2 +- drivers/media/pci/saa7134/saa7134-video.c | 15 +++--- drivers/media/pci/saa7146/mxb.c | 2 +- drivers/media/pci/saa7164/saa7164-core.c | 2 +- drivers/media/pci/saa7164/saa7164-dvb.c | 10 ++-- drivers/media/pci/saa7164/saa7164-encoder.c | 10 ++-- drivers/media/pci/saa7164/saa7164-i2c.c | 2 +- drivers/media/pci/saa7164/saa7164-vbi.c | 4 +- drivers/media/pci/smipcie/smipcie-main.c | 12 ++--- drivers/media/pci/solo6x10/solo6x10-g723.c | 8 +-- .../media/pci/solo6x10/solo6x10-v4l2-enc.c | 13 +++-- drivers/media/pci/solo6x10/solo6x10-v4l2.c | 6 +-- drivers/media/pci/sta2x11/sta2x11_vip.c | 6 +-- drivers/media/pci/ttpci/av7110.c | 3 +- drivers/media/pci/ttpci/av7110_v4l.c | 2 +- drivers/media/pci/ttpci/budget-core.c | 6 ++- drivers/media/pci/tw5864/tw5864-video.c | 2 +- drivers/media/pci/tw68/tw68-video.c | 6 +-- drivers/media/pci/tw686x/tw686x-audio.c | 8 +-- drivers/media/pci/tw686x/tw686x-video.c | 4 +- drivers/media/platform/am437x/am437x-vpfe.c | 11 ++-- drivers/media/platform/atmel/atmel-isc.c | 8 +-- drivers/media/platform/atmel/atmel-isi.c | 10 ++-- drivers/media/platform/coda/coda-common.c | 8 +-- drivers/media/platform/davinci/vpbe_display.c | 8 +-- drivers/media/platform/davinci/vpbe_venc.c | 2 +- drivers/media/platform/davinci/vpfe_capture.c | 8 +-- drivers/media/platform/davinci/vpif_capture.c | 14 ++--- drivers/media/platform/davinci/vpif_display.c | 12 ++--- drivers/media/platform/exynos-gsc/gsc-core.c | 2 +- drivers/media/platform/exynos-gsc/gsc-m2m.c | 4 +- drivers/media/platform/exynos4-is/common.c | 4 +- .../media/platform/exynos4-is/fimc-capture.c | 4 +- .../media/platform/exynos4-is/fimc-is-i2c.c | 2 +- .../platform/exynos4-is/fimc-isp-video.c | 2 +- drivers/media/platform/exynos4-is/fimc-lite.c | 6 +-- drivers/media/platform/exynos4-is/fimc-m2m.c | 2 +- drivers/media/platform/exynos4-is/media-dev.c | 8 +-- drivers/media/platform/fsl-viu.c | 8 +-- drivers/media/platform/m2m-deinterlace.c | 8 +-- .../media/platform/marvell-ccic/cafe-driver.c | 2 +- .../media/platform/marvell-ccic/mcam-core.c | 12 ++--- .../media/platform/marvell-ccic/mmp-driver.c | 2 +- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 4 +- drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 6 +-- .../platform/mtk-vcodec/mtk_vcodec_dec.c | 6 +-- .../platform/mtk-vcodec/mtk_vcodec_enc.c | 6 +-- drivers/media/platform/mtk-vpu/mtk_vpu.c | 2 +- drivers/media/platform/mx2_emmaprp.c | 6 +-- drivers/media/platform/omap/omap_vout.c | 10 ++-- drivers/media/platform/omap3isp/isp.c | 2 +- drivers/media/platform/omap3isp/ispccdc.c | 2 +- drivers/media/platform/omap3isp/ispccp2.c | 2 +- drivers/media/platform/omap3isp/ispcsi2.c | 2 +- drivers/media/platform/omap3isp/isppreview.c | 2 +- drivers/media/platform/omap3isp/ispresizer.c | 2 +- drivers/media/platform/omap3isp/ispvideo.c | 8 +-- drivers/media/platform/pxa_camera.c | 8 +-- .../media/platform/qcom/camss/camss-video.c | 8 +-- drivers/media/platform/qcom/camss/camss.c | 2 +- drivers/media/platform/qcom/venus/vdec.c | 8 +-- drivers/media/platform/qcom/venus/venc.c | 8 +-- drivers/media/platform/rcar-vin/rcar-core.c | 4 +- drivers/media/platform/rcar-vin/rcar-v4l2.c | 8 +-- drivers/media/platform/rcar_drif.c | 4 +- drivers/media/platform/rcar_fdp1.c | 6 +-- drivers/media/platform/rcar_jpu.c | 10 ++-- drivers/media/platform/renesas-ceu.c | 6 +-- drivers/media/platform/rockchip/rga/rga.c | 6 +-- .../media/platform/s3c-camif/camif-capture.c | 10 ++-- drivers/media/platform/s3c-camif/camif-core.c | 4 +- drivers/media/platform/s5p-g2d/g2d.c | 6 +-- drivers/media/platform/s5p-jpeg/jpeg-core.c | 10 ++-- drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 6 +-- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 6 +-- drivers/media/platform/sh_veu.c | 9 ++-- drivers/media/platform/sh_vou.c | 10 ++-- .../soc_camera/sh_mobile_ceu_camera.c | 6 +-- .../media/platform/soc_camera/soc_camera.c | 8 +-- .../platform/soc_camera/soc_camera_platform.c | 2 +- drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 4 +- drivers/media/platform/sti/delta/delta-v4l2.c | 4 +- drivers/media/platform/sti/hva/hva-v4l2.c | 4 +- drivers/media/platform/stm32/stm32-dcmi.c | 10 ++-- drivers/media/platform/ti-vpe/cal.c | 6 +-- drivers/media/platform/ti-vpe/vpe.c | 6 +-- drivers/media/platform/via-camera.c | 10 ++-- drivers/media/platform/vicodec/vicodec-core.c | 10 ++-- drivers/media/platform/vim2m.c | 6 +-- drivers/media/platform/vimc/vimc-capture.c | 6 +-- drivers/media/platform/vimc/vimc-common.c | 2 +- drivers/media/platform/vimc/vimc-core.c | 4 +- drivers/media/platform/vivid/vivid-cec.c | 4 +- drivers/media/platform/vivid/vivid-core.c | 4 +- drivers/media/platform/vivid/vivid-osd.c | 2 +- .../media/platform/vivid/vivid-radio-common.c | 4 +- drivers/media/platform/vivid/vivid-radio-rx.c | 2 +- drivers/media/platform/vivid/vivid-radio-tx.c | 2 +- drivers/media/platform/vivid/vivid-rds-gen.c | 4 +- drivers/media/platform/vivid/vivid-sdr-cap.c | 4 +- drivers/media/platform/vivid/vivid-vid-cap.c | 2 +- drivers/media/platform/vsp1/vsp1_drv.c | 2 +- drivers/media/platform/vsp1/vsp1_histo.c | 4 +- drivers/media/platform/vsp1/vsp1_video.c | 4 +- drivers/media/platform/xilinx/xilinx-dma.c | 6 +-- drivers/media/platform/xilinx/xilinx-tpg.c | 2 +- drivers/media/platform/xilinx/xilinx-vipp.c | 2 +- drivers/media/radio/dsbr100.c | 9 ++-- drivers/media/radio/radio-cadet.c | 12 ++--- drivers/media/radio/radio-isa.c | 10 ++-- drivers/media/radio/radio-keene.c | 8 +-- drivers/media/radio/radio-ma901.c | 8 +-- drivers/media/radio/radio-maxiradio.c | 2 +- drivers/media/radio/radio-miropcm20.c | 10 ++-- drivers/media/radio/radio-mr800.c | 8 +-- drivers/media/radio/radio-raremono.c | 8 +-- drivers/media/radio/radio-sf16fmi.c | 12 ++--- drivers/media/radio/radio-sf16fmr2.c | 6 +-- drivers/media/radio/radio-shark.c | 2 +- drivers/media/radio/radio-shark2.c | 2 +- drivers/media/radio/radio-si476x.c | 12 ++--- drivers/media/radio/radio-tea5764.c | 6 +-- drivers/media/radio/radio-tea5777.c | 12 ++--- drivers/media/radio/radio-timb.c | 8 +-- drivers/media/radio/radio-wl1273.c | 12 ++--- .../media/radio/si470x/radio-si470x-common.c | 2 +- drivers/media/radio/si470x/radio-si470x-i2c.c | 4 +- drivers/media/radio/si470x/radio-si470x-usb.c | 4 +- .../radio/si4713/radio-platform-si4713.c | 6 +-- drivers/media/radio/si4713/radio-usb-si4713.c | 6 +-- drivers/media/radio/si4713/si4713.c | 2 +- drivers/media/radio/tea575x.c | 10 ++-- drivers/media/radio/tef6862.c | 2 +- drivers/media/radio/wl128x/fmdrv_v4l2.c | 13 ++--- drivers/media/rc/ati_remote.c | 2 +- drivers/media/rc/imon.c | 4 +- drivers/media/rc/mceusb.c | 2 +- drivers/media/rc/streamzap.c | 2 +- drivers/media/tuners/e4000.c | 2 +- drivers/media/tuners/fc2580.c | 2 +- drivers/media/tuners/msi001.c | 2 +- drivers/media/tuners/mt20xx.c | 2 +- drivers/media/tuners/tuner-simple.c | 2 +- drivers/media/usb/airspy/airspy.c | 10 ++-- drivers/media/usb/au0828/au0828-i2c.c | 2 +- drivers/media/usb/au0828/au0828-video.c | 22 ++++---- drivers/media/usb/cpia2/cpia2_v4l.c | 12 ++--- drivers/media/usb/cx231xx/cx231xx-417.c | 2 +- drivers/media/usb/cx231xx/cx231xx-audio.c | 9 ++-- drivers/media/usb/cx231xx/cx231xx-input.c | 2 +- drivers/media/usb/cx231xx/cx231xx-video.c | 27 +++++----- drivers/media/usb/dvb-usb-v2/af9035.c | 2 +- drivers/media/usb/dvb-usb-v2/anysee.c | 2 +- drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 2 +- drivers/media/usb/dvb-usb-v2/gl861.c | 2 +- drivers/media/usb/dvb-usb-v2/lmedm04.c | 2 +- drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 18 +++---- drivers/media/usb/dvb-usb-v2/zd1301.c | 2 +- drivers/media/usb/dvb-usb/cxusb.c | 4 +- drivers/media/usb/dvb-usb/dib0700_devices.c | 4 +- drivers/media/usb/dvb-usb/dvb-usb-i2c.c | 2 +- drivers/media/usb/dvb-usb/dw2102.c | 4 +- drivers/media/usb/dvb-usb/technisat-usb2.c | 5 +- drivers/media/usb/em28xx/em28xx-audio.c | 8 +-- drivers/media/usb/em28xx/em28xx-i2c.c | 3 +- drivers/media/usb/em28xx/em28xx-video.c | 32 +++++------ drivers/media/usb/go7007/go7007-driver.c | 2 +- drivers/media/usb/go7007/go7007-usb.c | 16 +++--- drivers/media/usb/go7007/go7007-v4l2.c | 18 +++---- drivers/media/usb/go7007/snd-go7007.c | 8 +-- drivers/media/usb/gspca/gspca.c | 10 ++-- drivers/media/usb/gspca/sn9c20x.c | 2 +- drivers/media/usb/hackrf/hackrf.c | 12 ++--- drivers/media/usb/hdpvr/hdpvr-video.c | 18 +++---- drivers/media/usb/msi2500/msi2500.c | 8 +-- drivers/media/usb/pulse8-cec/pulse8-cec.c | 7 +-- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 6 +-- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 14 ++--- drivers/media/usb/pwc/pwc-if.c | 2 +- drivers/media/usb/pwc/pwc-v4l.c | 12 +++-- .../media/usb/rainshadow-cec/rainshadow-cec.c | 3 +- drivers/media/usb/s2255/s2255drv.c | 10 ++-- drivers/media/usb/stk1160/stk1160-i2c.c | 2 +- drivers/media/usb/stk1160/stk1160-v4l.c | 6 +-- drivers/media/usb/stkwebcam/stk-webcam.c | 21 +++++--- drivers/media/usb/tm6000/tm6000-alsa.c | 6 +-- drivers/media/usb/tm6000/tm6000-i2c.c | 4 +- drivers/media/usb/tm6000/tm6000-video.c | 13 ++--- .../media/usb/ttusb-budget/dvb-ttusb-budget.c | 3 +- drivers/media/usb/usbtv/usbtv-audio.c | 6 +-- drivers/media/usb/usbtv/usbtv-video.c | 14 ++--- drivers/media/usb/usbvision/usbvision-video.c | 29 +++++----- drivers/media/usb/uvc/uvc_ctrl.c | 4 +- drivers/media/usb/uvc/uvc_driver.c | 22 ++++---- drivers/media/usb/uvc/uvc_entity.c | 2 +- drivers/media/usb/uvc/uvc_metadata.c | 4 +- drivers/media/usb/uvc/uvc_v4l2.c | 10 ++-- drivers/media/usb/zr364xx/zr364xx.c | 10 ++-- drivers/media/v4l2-core/v4l2-common.c | 6 +-- drivers/media/v4l2-core/v4l2-ctrls.c | 8 +-- drivers/media/v4l2-core/v4l2-device.c | 2 +- .../media/v4l2-core/v4l2-flash-led-class.c | 2 +- drivers/media/v4l2-core/v4l2-ioctl.c | 8 +-- drivers/media/v4l2-core/v4l2-subdev.c | 2 +- drivers/staging/media/bcm2048/radio-bcm2048.c | 8 +-- .../staging/media/davinci_vpfe/dm365_ipipe.c | 2 +- .../media/davinci_vpfe/dm365_ipipeif.c | 2 +- .../staging/media/davinci_vpfe/dm365_isif.c | 2 +- .../media/davinci_vpfe/dm365_resizer.c | 6 +-- .../media/davinci_vpfe/vpfe_mc_capture.c | 3 +- .../staging/media/davinci_vpfe/vpfe_video.c | 6 +-- drivers/staging/media/imx/imx-ic-common.c | 2 +- drivers/staging/media/imx/imx-media-capture.c | 4 +- drivers/staging/media/imx/imx-media-dev.c | 4 +- drivers/staging/media/imx/imx-media-vdic.c | 2 +- drivers/staging/media/imx/imx6-mipi-csi2.c | 2 +- drivers/staging/media/omap4iss/iss.c | 2 +- drivers/staging/media/omap4iss/iss_ipipe.c | 2 +- drivers/staging/media/omap4iss/iss_ipipeif.c | 2 +- drivers/staging/media/omap4iss/iss_resizer.c | 2 +- drivers/staging/media/omap4iss/iss_video.c | 10 ++-- drivers/staging/media/zoran/zoran_card.c | 7 +-- drivers/staging/media/zoran/zoran_driver.c | 14 ++--- 321 files changed, 977 insertions(+), 927 deletions(-) -- 2.17.1