Re: [PATCH] mpi3mr: Fix W=1 compilation warnings

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

 



On Tue, Jun 29, 2021 at 9:14 AM Martin K. Petersen
<martin.petersen@xxxxxxxxxx> wrote:
>
>
> Sreekanth,
>
> > -     strncpy(drv_info->os_name, utsname()->sysname, sizeof(drv_info->os_name));
> > -     drv_info->os_name[sizeof(drv_info->os_name) - 1] = 0;
> > -     strncpy(drv_info->os_version, utsname()->release, sizeof(drv_info->os_version));
> > -     drv_info->os_version[sizeof(drv_info->os_version) - 1] = 0;
> > +     memcpy(drv_info->os_name, utsname()->sysname, sizeof(drv_info->os_name) - 1);
> > +     memcpy(drv_info->os_version, utsname()->release, sizeof(drv_info->os_version) - 1);
>
> strscpy()?

Agreed. Posted a new patch using strscpy().

Thanks,
Sreekanth
>
> --
> Martin K. Petersen      Oracle Linux Engineering

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux