[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: checked integer arithmetic
From: |
Bruno Haible |
Subject: |
Re: checked integer arithmetic |
Date: |
Thu, 15 Dec 2016 03:17:29 +0100 |
User-agent: |
KMail/4.8.5 (Linux/3.8.0-44-generic; KDE/4.8.5; x86_64; ; ) |
Paul Eggert wrote:
> Come to think of it, I suppose we should change xalloc_oversized to
> report an overflow if the resulting size would be greater than
> PTRDIFF_MAX. That should catch more potential problems in Gnulib and in
> Gnulib-using code.
> ...
> Here is an example of why arrays larger than PTRDIFF_MAX bytes can cause
> real problems.
So, an attempt to allocate a memory chunk of 2.5 GB size on 32-bit Linux/x86
is ill-fated already? That is, SIZE_MAX = 4 GB - 1 gives us a fake illusion
that allocations > 2 GB would be OK, and in fact they are not OK, so it's
in fact ssize_t or ptrdiff_t that matters?!
Bruno
- FYI: dfa: add an assertion to avoid coverity false positive, Jim Meyering, 2016/12/14
- Re: FYI: dfa: add an assertion to avoid coverity false positive, Paul Eggert, 2016/12/14
- Re: checked integer arithmetic, Bruno Haible, 2016/12/14
- Re: checked integer arithmetic, Eric Blake, 2016/12/14
- Re: checked integer arithmetic, Paul Eggert, 2016/12/14
- xalloc-oversized PTRDIFF_MAX fix (was: checked integer arithmetic), Paul Eggert, 2016/12/14
- Re: checked integer arithmetic,
Bruno Haible <=
- Re: checked integer arithmetic, Bruno Haible, 2016/12/15
- Re: checked integer arithmetic, Paul Eggert, 2016/12/15
- Re: checked integer arithmetic, Bruno Haible, 2016/12/15
- Re: checked integer arithmetic, Bruno Haible, 2016/12/15
- Re: checked integer arithmetic, Paul Eggert, 2016/12/16
Re: FYI: dfa: add an assertion to avoid coverity false positive, Paul Eggert, 2016/12/14