This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: v4l-utils: fix potential crashing with 32-bit musl
Author:  Rosen Penev <ros...@gmail.com>
Date:    Tue Jul 2 12:33:41 2024 -0700

Under musl, if a format string has an integer followed by %s, a mismatch
between types can cause the second half of the integer to be interpreted
by %s.

Eg: printf("%d %s", 64bittype, string);

will crash, especially on 32-bit big endian.

The reason these are cast to __u64 is because time_t and suseconds_t
are 64-bit under musl, even on 32-bit platforms. __u64 helps avoid
any truncation issues that may or may not arise.

Signed-off-by: Rosen Penev <ros...@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>
[hverkuil: the change to cec-follower was dropped]

 utils/libv4l2util/v4l2_driver.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=fbc9c1cfd08c1df671322b23d1f8f5061988c926
diff --git a/utils/libv4l2util/v4l2_driver.c b/utils/libv4l2util/v4l2_driver.c
index 6b6366faf906..51e97b61e327 100644
--- a/utils/libv4l2util/v4l2_driver.c
+++ b/utils/libv4l2util/v4l2_driver.c
@@ -174,13 +174,13 @@ static void prt_buf_info(char *name,struct v4l2_buffer *p)
 {
        struct v4l2_timecode *tc=&p->timecode;
 
-       printf ("%s: %02ld:%02d:%02d.%08ld index=%d, type=%s, "
+       printf ("%s: %02llu:%02d:%02d.%08llu index=%d, type=%s, "
                "bytesused=%d, flags=0x%08x, "
                "field=%s, sequence=%d, memory=%s, offset=0x%08x, length=%d\n",
-               name, (p->timestamp.tv_sec/3600),
+               name, (__u64)(p->timestamp.tv_sec/3600),
                (int)(p->timestamp.tv_sec/60)%60,
                (int)(p->timestamp.tv_sec%60),
-               p->timestamp.tv_usec,
+               (__u64)p->timestamp.tv_usec,
                p->index,
                prt_names(p->type,v4l2_type_names),
                p->bytesused,p->flags,

Reply via email to