Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Edited by NavBot (vkp) v1.0

...

This rule appears in the C++ Secure Coding Standard as ARR36-CPP. Do not subtract or compare two pointers or iterators that do not refer to the same array or container.

...

Bibliography

Wiki Markup
\[[Banahan 03|AA. Bibliography#Banahan 03]\] [Section 5.3, "Pointers,"|http://publications.gbdirect.co.uk/c_book/chapter5/pointers.html] and [Section 5.7, "Expressions involving pointers"|http://publications.gbdirect.co.uk/c_book/chapter5/pointer_expressions.html]
\[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] Section 6.5.6, "Additive operators"
\[[MITRE 07|AA. Bibliography#MITRE 07]\] [CWE ID 469|http://cwe.mitre.org/data/definitions/469.html], "Use of Pointer Subtraction to Determine Size"

...

ARR35ARR34-C. Do not allow loops to iterate beyond the end of an arrayEnsure that array types in expressions are compatible      06. Arrays (ARR)