Re: Type mismatches in safe_read and friends?

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

 



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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]