lkml.org 
[lkml]   [2016]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectwhen to size t for representing length instead of in t ?
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,

\
 
 \ /
  Last update: 2016-10-14 00:21    [W:0.042 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site