Re: [PATCH blktests] blktests: Fix compilation warning

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

 



On Mon, Dec 17, 2018 at 02:51:08PM +0900, Damien Le Moal wrote:
> Fix strncpy length to "sizeof(buf) - 1" to avoid the compiler warning:
> cc  -O2 -Wall -Wshadow  -o sg/syzkaller1 sg/syzkaller1.c
> sg/syzkaller1.c: In function ‘syz_open_dev.constprop’:
> sg/syzkaller1.c:204:16: warning: ‘strncpy’ specified bound 1024 equals
> destination size [-Wstringop-truncation]
>      NONFAILING(strncpy(buf, (char*)a0, sizeof(buf)));
>                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> sg/syzkaller1.c:143:7: note: in definition of macro ‘NONFAILING’
>        __VA_ARGS__;                                                     \
>        ^~~~~~~~~~~
> 
> Since the last character of buf is forced set to 0, there is no
> functional change introduced by this patch.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxx>

Applied, thanks, Damien.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux