Re: [patch] isdn: icn: buffer overflow in icn_command()

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

 



On Wed, 2014-04-16 at 14:16 +0300, Dan Carpenter wrote:

> snprintf() returns the number of bytes which would have been printed if
> there were enough space and not the number of bytes in the string.
> Using the value from snprintf() would not introduce a bug because I have
> carefully counted the number of bytes in the output string, but it would
> hopefully annoy human auditors of this code.  ;)  You are thinking of
> scnprintf().

Not really, I was assuming you'd use max() too
but you're right, scnprintf is more sensible.

> I'm going to apply your minimal changes suggestion here.

swell, thanks

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux