mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: consider null character for strncat
While forming string available length to strncat should consider null character in last byte otherwise strncat can index the array out of bounds. CID 481139 CID 455841 Bug 3512546 Change-Id: I011be1deea40e276e681965deefb60fe8ab79479 Signed-off-by: Sagar Kamble <skamble@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2710380 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
mobile promotions
parent
da884615d3
commit
b7d436fd0e
@@ -48,7 +48,7 @@
|
|||||||
*/
|
*/
|
||||||
void nvgpu_dma_flags_to_str(struct gk20a *g, unsigned long flags, char *buf)
|
void nvgpu_dma_flags_to_str(struct gk20a *g, unsigned long flags, char *buf)
|
||||||
{
|
{
|
||||||
int bytes_available = NVGPU_DMA_STR_SIZE;
|
int bytes_available = NVGPU_DMA_STR_SIZE - 1;
|
||||||
|
|
||||||
memset(buf, 0, NVGPU_DMA_STR_SIZE);
|
memset(buf, 0, NVGPU_DMA_STR_SIZE);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user