Re: [PATCH v4] lib/vsprintf: Add support for generic FOURCCs by extending %p4cc

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

 



On Fri, 28 Feb 2025 14:09:48 +0000
Aditya Garg <gargaditya08@xxxxxxxx> wrote:

> > -    *p++ = ' ';
> > -    strcpy(p, orig & BIT(31) ? "big-endian" : "little-endian");
> > -    p += strlen(p);
> > +    if (pixel_fmt) {
> > +        *p++ = ' ';
> > +        strcpy(p, orig & BIT(31) ? "big-endian" : "little-endian");  
> 
> Do we need strscpy here?

Why? The size of what p points to has already been calculated to hold this:

	char output[sizeof("0123 little-endian (0x01234567)")];
	char *p = output;

Unless you changed something, it will not overflow.

-- Steve




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux