[Secure Coding] master: Correct advice on array allocatoin (#995595) (876a1bc)

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

 



Repository : http://git.fedorahosted.org/git/?p=secure-coding.git

On branch  : master

>---------------------------------------------------------------

commit 876a1bcbd0b2687867aded985d142df5030988ae
Author: Florian Weimer <fweimer@xxxxxxxxxx>
Date:   Mon Aug 26 11:43:10 2013 +0200

    Correct advice on array allocatoin (#995595)


>---------------------------------------------------------------

 defensive-coding/en-US/C/Allocators.xml |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/defensive-coding/en-US/C/Allocators.xml b/defensive-coding/en-US/C/Allocators.xml
index e86b37f..1bff610 100644
--- a/defensive-coding/en-US/C/Allocators.xml
+++ b/defensive-coding/en-US/C/Allocators.xml
@@ -135,8 +135,8 @@
       is used, the size check must be written manually.  For instance,
       to allocate an array of <literal>n</literal> elements of type
       <literal>T</literal>, check that the requested size is not
-      greater than <literal>n / sizeof(T)</literal>.  See <xref
-      linkend="sect-Defensive_Coding-C-Arithmetic"/>.
+      greater than <literal>((size_t) -1) / sizeof(T)</literal>.  See
+      <xref linkend="sect-Defensive_Coding-C-Arithmetic"/>.
     </para>
   </section>
 

--
security mailing list
security@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/security





[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Coolkey]

  Powered by Linux