git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rogan Dawes <lists@dawes.za.net>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Type mismatches in safe_read and friends?
Date: Tue, 27 Mar 2007 12:34:03 +0200	[thread overview]
Message-ID: <4608F31B.8070204@dawes.za.net> (raw)
In-Reply-To: <20070326164755.GH13247@spearce.org>

Shawn O. Pearce wrote:
>  
>> Or is it just a case that we don't really care, since we control the 
>> ranges of the values, and the underlying types are int anyway? Patches 
>> to follow if I get an indication that anyone cares, otherwise I'd be 
>> posting my question to a C newbies group. ;-)
> 
> It is sort of a case we don't care.  These probably should be fixed.
> A patch would be nice.  You want to learn C...  ;-)
> 

Ok. So I did a little patch, but I'm not sure whether I solved anything. 
Now we have an implicit cast from size_t to ssize_t in packet_read_line.

I guess this echoes your comment about requesting a large size_t, and 
getting a ssize_t result back. I suppose in theory we should be refusing 
to handle a length greater than that which would fit into a ssize_t? Or 
simply making sure to always return data smaller than max(ssize_t)?

Patch to follow.

Rogan

      reply	other threads:[~2007-03-27 10:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-26 14:13 Type mismatches in safe_read and friends? Rogan Dawes
2007-03-26 16:47 ` Shawn O. Pearce
2007-03-27 10:34   ` Rogan Dawes [this message]

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=4608F31B.8070204@dawes.za.net \
    --to=lists@dawes.za.net \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).