All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Mielke <mark@mark.mielke.cc>
To: Chris Friesen <cfriesen@nortelnetworks.com>
Cc: Steven French <sfrench@us.ibm.com>,
	acc@CS.Stanford.EDU, linux-kernel@vger.kernel.org
Subject: Re: [CHECKER] 16 more potential buffer overruns in 2.5.48
Date: Wed, 20 Nov 2002 13:02:27 -0500	[thread overview]
Message-ID: <20021120180227.GA30331@mark.mielke.cc> (raw)
In-Reply-To: <3DDBC230.6000908@nortelnetworks.com>

On Wed, Nov 20, 2002 at 12:11:12PM -0500, Chris Friesen wrote:
> Steven French wrote:
> > As long as unsigned char can never go above 255 the code should
> >work.   It might have be more readable if it were defined as a  __u8
> >instead of an unsigned char.
> Technically there is nothing that guarantees that an unsigned char is <= 
> 8 bytes in size (although in practice it often is the case).
> __u8 would definately be the way to go.

I believe C99 defines 'char' as the smallest addressable unit of
memory. Meaning -- it would be difficult to define 'u8' where 'char'
was larger than 8 bits. This is why the wchar_t stuff came about.

Is is doubtful than any new hardware would be made so difficult to
port code to. Older hardware that used 6 bit bytes (among other sizes)
should be obsoleted.

That being said... the code should probably check the size, and allow
the host compiler to choose whether or not to optimize the check away.

mark

-- 
mark@mielke.cc/markm@ncf.ca/markm@nortelnetworks.com __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada

  One ring to rule them all, one ring to find them, one ring to bring them all
                       and in the darkness bind them...

                           http://mark.mielke.cc/


  reply	other threads:[~2002-11-20 17:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-20 16:56 [CHECKER] 16 more potential buffer overruns in 2.5.48 Steven French
2002-11-20 17:05 ` Jeff Garzik
2002-11-20 17:11 ` Chris Friesen
2002-11-20 18:02   ` Mark Mielke [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-11-20  8:49 Andy Chou
2002-11-30 23:51 ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021120180227.GA30331@mark.mielke.cc \
    --to=mark@mark.mielke.cc \
    --cc=acc@CS.Stanford.EDU \
    --cc=cfriesen@nortelnetworks.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfrench@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.