Hi Jeff,
On Fri, 26 Jun 2026, Jeff Layton wrote:
> ioctl10: fix the sscanf() call to handle 64-bit inode on 32-bit arch
> - unsigned long vm_inode;
> + uint64_t vm_inode;
> - if (sscanf(line, "%lx-%lx %s %lx %x:%x %lu %s",
> + if (sscanf(line, "%lx-%lx %s %lx %x:%x %llu %s",
The type change to uint64_t is correct, but %llu is the format
specifier for unsigned long long, not for uint64_t. On LP64
platforms (x86_64, aarch64), uint64_t is unsigned long, so passing
a uint64_t * where sscanf expects unsigned long long * is
undefined behavior and will produce -Wformat warnings on 64-bit
builds.
The portable fix is to use SCNu64 from <inttypes.h>:
if (sscanf(line, "%lx-%lx %s %lx %x:%x %" SCNu64 " %s",
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.