Re: [PATCH V3] Fix NULL dereference in super_by_fd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  			*subarrayp = subarray;
>  		strcpy(st->container_devnm, container);
> -		strcpy(st->devnm, fd2devnm(fd));
> +		strncpy(st->devnm, devnm, MD_NAME_MAX);

Sorry for bothering you again but there is one nit. Strncpy implementation
doesn't guarantee '\0' ended string- static code analysis may warn. In this
case you can use:
strncpy(st->devnm, devnm, MD_NAME_MAX - 1);
or
snprintf(st->devnm, MD_NAME_MAX, "%s", devnm);

Thanks,
Mariusz



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux