Re: [PATCH 30/32] strlen.3, wcslen.3: Add recommendations for safer variants

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

 



Hi Michael,

On 8/8/21 3:20 AM, Michael Kerrisk (man-pages) wrote:
I have some doubts about this patch, but in a completely different sense:

I don't know if I'm being a bit paranoid in treating user input.  I've
always been taught that I should program deffensively, but as time
passes by, I realize myself that I was programming too much
deffensively, and even introducing bugs in the error handling code.  And
in many cases, strings will always be NUL-terminated, so maybe I'm just
passing around a wrong recommendation.

What do you think about this?

How about a sentence something like:

[[
In cases where the input buffer may not contain a terminating null byte,
.BR strnlen (3)
should be used instead.
]]

What do you think?

Yes, that's much better.  Thanks!

Alex


Thanks,

Michael



--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux