All of lore.kernel.org
 help / color / mirror / Atom feed
* when to size_t for representing length instead of int ?
@ 2016-10-13 22:12 none
  2016-10-13 23:37 ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: none @ 2016-10-13 22:12 UTC (permalink / raw)
  To: linux-kernel

Hello,

I wanted to known the rules in coding guidelines concerning the use of 
size_t.
It seems the signed int type is used most of the time for representing 
string sizes, including in some parts written by Linus in /lib.
They’re can buffer overflows attack if ssize_t if larger than 
sizeof(int) (though I agree this isn’t the only way, but at least it´s 
less error prone).

So is it guaranteed for all current and future cpu architectures the 
Linux kernel support that ssize_t will always be equal to sizeof(int) ?

regards,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-16  2:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-13 22:12 when to size_t for representing length instead of int ? none
2016-10-13 23:37 ` Al Viro
2016-10-16  2:04   ` none

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.