• Mauro Carvalho Chehab's avatar
    media: sti: don't copy past the size · 54e80d98
    Mauro Carvalho Chehab authored
    The logic at delta_ipc_open() tries to copy past the size of
    the name passed to it:
    
    	drivers/media/platform/sti/delta/delta-ipc.c:178 delta_ipc_open() error: __memcpy() 'name' too small (17 vs 32)
    
    Basically,this function is called just one with:
    
    	ret = delta_ipc_open(pctx, "JPEG_DECODER_HW0", ...);
    
    The string used there has just 17 bytes. Yet, the logic tries
    to copy the entire name size (32 bytes), which is plain wrong.
    
    Replace it by strscpy, which is good enough to copy the string,
    warranting that this will be NUL-terminated.
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
    54e80d98
delta-ipc.c 14.5 KB