Re: [PATCH 1/2] Replace snprintf with strncpy at some places to avoid truncation

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

 



Xiao Ni <xni@xxxxxxxxxx> writes:
> In gcc7 there are some building errors like:
> directive output may be truncated writing up to 31 bytes into a region of size 24
> snprintf(str, MPB_SIG_LEN, %s, mpb->sig);
>
> It just need to copy one string to target. So use strncpy to replace it.
>
> For this line code: snprintf(str, MPB_SIG_LEN, %s, mpb->sig);
> Because mpb->sig has the content of version after magic, so
> it's better to use strncpy to replace snprintf too.
>
> Signed-off-by: Xiao Ni <xni@xxxxxxxxxx>
> ---
>  super-intel.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

Applied!

Thanks,
Jes
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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