summaryrefslogtreecommitdiff
path: root/drivers/s390/block
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2018-06-17 01:30:43 +0300
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2018-07-02 12:24:50 +0300
commit6b2ddf33baec23dace85bd647e3fc4ac070963e8 (patch)
treed2ca4ccd93e428556bcafbc4b673ad2f7237f906 /drivers/s390/block
parentd642d6262f4fcfa5d200ec6e218c17f0c15b3390 (diff)
downloadlinux-6b2ddf33baec23dace85bd647e3fc4ac070963e8.tar.xz
s390/extmem: fix gcc 8 stringop-overflow warning
arch/s390/mm/extmem.c: In function '__segment_load': arch/s390/mm/extmem.c:436:2: warning: 'strncat' specified bound 7 equals source length [-Wstringop-overflow=] strncat(seg->res_name, " (DCSS)", 7); What gcc complains about here is the misuse of strncat function, which in this case does not limit a number of bytes taken from "src", so it is in the end the same as strcat(seg->res_name, " (DCSS)"); Keeping in mind that a res_name is 15 bytes, strncat in this case would overflow the buffer and write 0 into alignment byte between the fields in the struct. To avoid that increasing res_name size to 16, and reusing strlcat. Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/block')
0 files changed, 0 insertions, 0 deletions