PATCH: ctdb: buffer write beyond limits

swen swen at linux.ibm.com
Thu Feb 21 07:43:11 UTC 2019


Hi Douglas

Thanks for your comments.

On Thu, 2019-02-21 at 10:58 +1300, Douglas Bagnall wrote:
> Hi Swen,
> 
> I haven't been following this thread, but your simple maths seems
> wrong.
> 
> > the code is right if the following facts are taken into account.
> > 1. MAX_SIGNED_INT = MAX_UNSIGNED_INT/2 - 1
> 
> No, not if by MAX_(UN)SIGNED_INT you mean (U)INT_MAX, which are often
> 2 ** 32 - 1 and 2 ** 31 - 1, or 4294967295 and 2147483647.
I guess I was thinking of the number of values and not the maximum
value.

...anyway, the point I wanted to make is that it just cannot overflow,
if that's by one or by two wasn't too relevant to me at the time. 
But of course you're right, should have prepared "my case"
more carefully.

Thanks.

Cheers Swen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190221/e54d84bb/signature.sig>


More information about the samba-technical mailing list