]>
git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
fstests: aiodio_sparse2.c, fix compiler warning buffer overflow
The warning is due to 'strncpy' with a maximum number of characters
equal to the destination buffer size, without space for null termination.
aiodio_sparse2.c: In function 'main':
aiodio_sparse2.c:404:9: warning: 'strncpy' specified bound 4096 equals destination size [-Wstringop-truncation]
404 | strncpy(filename, argv[argc-1], PATH_MAX);
However, PATH_MAX is including null termination at the end. Anyways, fix
warning by setting NULL.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>