Skip to main content
assistive.skiplink.to.breadcrumbs
assistive.skiplink.to.header.menu
assistive.skiplink.to.action.menu
assistive.skiplink.to.quick.search
Log in
Confluence
Spaces
Hit enter to search
Help
Online Help
Keyboard Shortcuts
Feed Builder
What’s new
Available Gadgets
About Confluence
Log in
SEI CERT C Coding Standard
Pages
Boards
Space shortcuts
Dashboard
Secure Coding Home
Android
C
C++
Java
Perl
Page tree
Browse pages
Configure
Space tools
View Page
A
t
tachments (0)
Page History
Page Information
View in Hierarchy
View Source
Export to PDF
Export to Word
Pages
…
SEI CERT C Coding Standard
4 Back Matter
EE. Analyzers
LDRA_V
Page Information
Title:
LDRA_V
Author:
Robert Seacord (Manager)
Jun 24, 2010
Last Changed by:
Liz Whiting
Oct 23, 2017
Tiny Link:
(useful for email)
https://wiki.sei.cmu.edu/confluence/x/_tYxBQ
Export As:
Word
·
PDF
Incoming Links
SEI CERT C Coding Standard (207)
Page:
ARR02-C. Explicitly specify array bounds, even if implicitly defined by an initializer
Page:
DCL15-C. Declare file-scope objects or functions that do not need external linkage as static
Page:
PRE01-C. Use parentheses within macros around parameter names
Page:
PRE07-C. Avoid using repeated question marks
Page:
EXP43-C. Avoid undefined behavior when using restrict-qualified pointers
Page:
FIO47-C. Use valid format strings
Page:
STR04-C. Use plain char for characters in the basic character set
Page:
DCL36-C. Do not declare an identifier with conflicting linkage classifications
Page:
EXP39-C. Do not access a variable through a pointer of an incompatible type
Page:
MEM30-C. Do not access freed memory
Page:
PRE31-C. Avoid side effects in arguments to unsafe macros
Page:
STR05-C. Use pointers to const when referring to string literals
Page:
INT12-C. Do not make assumptions about the type of a plain int bit-field when used in an expression
Page:
STR10-C. Do not concatenate different type of string literals
Page:
STR34-C. Cast characters to unsigned char before converting to larger integer sizes
Page:
INT14-C. Avoid performing bitwise and arithmetic operations on the same data
Page:
ERR01-C. Use ferror() rather than errno to check for FILE stream errors
Page:
EXP00-C. Use parentheses for precedence of operation
Page:
DCL00-C. Const-qualify immutable objects
Page:
DCL31-C. Declare identifiers before using them
Page:
CON37-C. Do not call signal() in a multithreaded program
Page:
STR32-C. Do not pass a non-null-terminated character sequence to a library function that expects a string
Page:
ARR00-C. Understand how arrays work
Page:
EXP20-C. Perform explicit tests to determine success, true and false, and equality
Page:
DCL19-C. Minimize the scope of variables and functions
Page:
FIO30-C. Exclude user input from format strings
Page:
EXP35-C. Do not modify objects with temporary lifetime
Page:
ENV03-C. Sanitize the environment when invoking external programs
Page:
FIO34-C. Distinguish between characters read from a file and EOF or WEOF
Page:
FIO41-C. Do not call getc(), putc(), getwc(), or putwc() with a stream argument that has side effects
Page:
MEM12-C. Consider using a goto chain when leaving a function on error when using and releasing resources
Page:
EXP46-C. Do not use a bitwise operator with a Boolean-like operand
Page:
FIO44-C. Only use values for fsetpos() that are returned from fgetpos()
Page:
DCL10-C. Maintain the contract between the writer and caller of variadic functions
Page:
PRE00-C. Prefer inline or static functions to function-like macros
Page:
DCL30-C. Declare objects with appropriate storage durations
Page:
EXP16-C. Do not compare function pointers to constant values
Page:
EXP12-C. Do not ignore values returned by functions
Page:
FLP34-C. Ensure that floating-point conversions are within range of the new type
Page:
EXP37-C. Call functions with the correct number and type of arguments
Page:
PRE03-C. Prefer typedefs to defines for encoding non-pointer types
Page:
STR00-C. Represent characters using an appropriate type
Page:
INT15-C. Use intmax_t or uintmax_t for formatted IO on programmer-defined integer types
Page:
MSC22-C. Use the setjmp(), longjmp() facility securely
Page:
DCL38-C. Use the correct syntax when declaring a flexible array member
Page:
FIO20-C. Avoid unintentional truncation when using fgets() or fgetws()
Page:
FIO39-C. Do not alternately input and output from a stream without an intervening flush or positioning call
Page:
DCL05-C. Use typedefs of non-pointer types only
Page:
MSC24-C. Do not use deprecated or obsolescent functions
Page:
EXP07-C. Do not diminish the benefits of constants by assuming their values in expressions
Page:
FIO24-C. Do not open a file that is already open
Page:
MEM05-C. Avoid large stack allocations
Page:
FIO37-C. Do not assume that fgets() or fgetws() returns a nonempty string when successful
Page:
FIO01-C. Be careful using functions that use file names for identification
Page:
FLP06-C. Convert integers to floating point for floating-point operations
Page:
STR11-C. Do not specify the bound of a character array initialized with a string literal
Page:
MSC40-C. Do not violate constraints
Page:
EXP30-C. Do not depend on the order of evaluation for side effects
Page:
ENV34-C. Do not store pointers returned by certain functions
Page:
MSC20-C. Do not use a switch statement to transfer control into a complex block
Page:
DCL01-C. Do not reuse variable names in subscopes
Page:
INT18-C. Evaluate integer expressions in a larger size before comparing or assigning to that size
Page:
FIO11-C. Take care when specifying the mode parameter of fopen()
Page:
MEM01-C. Store a new value in pointers immediately after free()
Page:
PRE30-C. Do not create a universal character name through concatenation
Page:
FLP37-C. Do not use object representations to compare floating-point values
Page:
MSC37-C. Ensure that control never reaches the end of a non-void function
Page:
MEM36-C. Do not modify the alignment of objects by calling realloc()
Page:
INT07-C. Use only explicitly signed or unsigned char type for numeric values
Page:
FIO05-C. Identify files using multiple file attributes
Page:
FIO38-C. Do not copy a FILE object
Page:
ERR32-C. Do not rely on indeterminate values of errno
Page:
ENV32-C. All exit handlers must return normally
Page:
FLP02-C. Avoid using floating-point numbers when precise computation is needed
Page:
MSC09-C. Character encoding: Use subset of ASCII for safety
Page:
EXP03-C. Do not assume the size of a structure is the sum of the sizes of its members
Page:
ARR36-C. Do not subtract or compare two pointers that do not refer to the same array
Page:
ERR33-C. Detect and handle standard library errors
Page:
INT16-C. Do not make assumptions about representation of signed integers
Page:
INT08-C. Verify that all integer values are in range
Page:
EXP11-C. Do not make assumptions regarding the layout of structures with bit-fields
Page:
MSC05-C. Do not manipulate time_t typed values directly
Page:
PRE02-C. Macro replacement lists should be parenthesized
Page:
LDRA
Page:
FIO08-C. Take care when calling remove() on an open file
Page:
DCL13-C. Declare function parameters that are pointers to values not changed by the function as const
Page:
EXP32-C. Do not access a volatile object through a nonvolatile reference
Page:
EXP44-C. Do not rely on side effects in operands to sizeof, _Alignof, or _Generic
Page:
FIO22-C. Close files before spawning processes
Page:
DCL02-C. Use visually distinct identifiers
Page:
MEM10-C. Define and use a pointer validation function
Page:
EXP36-C. Do not cast pointers into more strictly aligned pointer types
Page:
FIO42-C. Close files when they are no longer needed
Page:
INT36-C. Converting a pointer to integer or integer to pointer
Page:
PRE10-C. Wrap multistatement macros in a do-while loop
Page:
SIG34-C. Do not call signal() from within interruptible signal handlers
Page:
EXP34-C. Do not dereference null pointers
Page:
EXP13-C. Treat relational and equality operators as if they were nonassociative
Page:
ENV31-C. Do not rely on an environment pointer following an operation that may invalidate it
Page:
SIG00-C. Mask signals handled by noninterruptible signal handlers
Page:
FLP03-C. Detect and handle floating-point errors
Page:
SIG31-C. Do not access shared objects in signal handlers
Page:
MSC06-C. Beware of compiler optimizations
Page:
DCL18-C. Do not begin integer constants with 0 when specifying a decimal value
Page:
STR30-C. Do not attempt to modify string literals
Page:
MSC17-C. Finish every set of statements associated with a case label with a break statement
Page:
DCL04-C. Do not declare more than one variable per declaration
Page:
INT02-C. Understand integer conversion rules
Page:
ERR30-C. Take care when reading errno
Page:
FIO46-C. Do not access a closed file
Page:
STR09-C. Don't assume numeric values for expressions with type plain character
Page:
MSC30-C. Do not use the rand() function for generating pseudorandom numbers
Page:
ARR39-C. Do not add or subtract a scaled integer to a pointer
Page:
DCL41-C. Do not declare variables inside a switch statement before the first case label
Page:
MSC12-C. Detect and remove code that has no effect or is never executed
Page:
EXP10-C. Do not depend on the order of evaluation of subexpressions or the order in which side effects take place
Page:
EXP19-C. Use braces for the body of an if, for, or while statement
Page:
EXP47-C. Do not call va_arg with an argument of the incorrect type
Page:
ARR30-C. Do not form or use out-of-bounds pointers or array subscripts
Page:
DCL23-C. Guarantee that mutually visible identifiers are unique
Page:
MEM33-C. Allocate and copy structures containing a flexible array member dynamically
Page:
PRE04-C. Do not reuse a standard header file name
Page:
EXP05-C. Do not cast away a const qualification
Page:
SIG01-C. Understand implementation-specific details regarding signal handler persistence
Page:
ENV33-C. Do not call system()
Page:
EXP08-C. Ensure pointer arithmetic is used correctly
Page:
FIO03-C. Do not make assumptions about fopen() and file creation
Page:
EXP33-C. Do not read uninitialized memory
Page:
MEM34-C. Only free memory allocated dynamically
Page:
INT10-C. Do not assume a positive remainder when using the % operator
Page:
FIO17-C. Do not rely on an ending null character when using fread()
Page:
FIO18-C. Never expect fwrite() to terminate the writing process at a null character
Page:
INT30-C. Ensure that unsigned integer operations do not wrap
Page:
SIG30-C. Call only asynchronous-safe functions within signal handlers
Page:
DCL06-C. Use meaningful symbolic constants to represent literal values
Page:
DCL16-C. Use "L," not "l," to indicate a long value
Page:
INT31-C. Ensure that integer conversions do not result in lost or misinterpreted data
Page:
FIO19-C. Do not use fseek() and ftell() to compute the size of a regular file
Page:
FIO13-C. Never push back anything other than one read character
Page:
INT34-C. Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand
Page:
STR37-C. Arguments to character-handling functions must be representable as an unsigned char
Page:
ENV30-C. Do not modify the object referenced by the return value of certain functions
Page:
MSC01-C. Strive for logical completeness
Page:
ERR34-C. Detect errors when converting a string to a number
Page:
FIO06-C. Create files with appropriate access permissions
Page:
MSC13-C. Detect and remove unused values
Page:
MSC15-C. Do not depend on undefined behavior
Page:
POS54-C. Detect and handle POSIX library errors
Page:
STR02-C. Sanitize data passed to complex subsystems
Page:
PRE05-C. Understand macro replacement when concatenating tokens or performing stringification
Page:
INT05-C. Do not use input functions to convert character data if they cannot handle all possible inputs
Page:
DCL09-C. Declare functions that return errno with a return type of errno_t
Page:
EXP42-C. Do not compare padding data
Page:
MEM31-C. Free dynamically allocated memory when no longer needed
Page:
CON33-C. Avoid race conditions when using library functions
Page:
MEM03-C. Clear sensitive information stored in reusable resources
Page:
PRE32-C. Do not use preprocessor directives in invocations of function-like macros
Page:
ARR37-C. Do not add or subtract an integer to a pointer to a non-array object
Page:
MSC21-C. Use robust loop termination conditions
Page:
ARR32-C. Ensure size arguments for variable length arrays are in a valid range
Page:
MSC14-C. Do not introduce unnecessary platform dependencies
Page:
FIO02-C. Canonicalize path names originating from tainted sources
Page:
DCL22-C. Use volatile for data that cannot be cached
Page:
MEM00-C. Allocate and free memory in the same module, at the same level of abstraction
Page:
INT09-C. Ensure enumeration constants map to unique values
Page:
PRE12-C. Do not define unsafe macros
Page:
FLP30-C. Do not use floating-point variables as loop counters
Page:
MEM35-C. Allocate sufficient memory for an object
Page:
DCL17-C. Beware of miscompiled volatile-qualified variables
Page:
EXP45-C. Do not perform assignments in selection statements
Page:
PRE11-C. Do not conclude macro definitions with a semicolon
Page:
SIG02-C. Avoid using signals to implement normal functionality
Page:
DCL37-C. Do not declare or define a reserved identifier
Page:
MEM11-C. Do not assume infinite heap space
Page:
PRE06-C. Enclose header files in an include guard
Page:
EXP09-C. Use sizeof to determine the size of a type or variable
Page:
ARR38-C. Guarantee that library functions do not form invalid pointers
Page:
DCL12-C. Implement abstract data types using opaque types
Page:
STR03-C. Do not inadvertently truncate a string
Page:
FIO45-C. Avoid TOCTOU race conditions while accessing files
Page:
MSC10-C. Character encoding: UTF8-related issues
Page:
STR07-C. Use the bounds-checking interfaces for string manipulation
Page:
DCL11-C. Understand the type issues associated with variadic functions
Page:
MSC04-C. Use comments consistently and in a readable fashion
Page:
INT33-C. Ensure that division and remainder operations do not result in divide-by-zero errors
Page:
ARR01-C. Do not apply the sizeof operator to a pointer when taking the size of an array
Page:
ERR07-C. Prefer functions that support error checking over equivalent functions that don't
Page:
STR06-C. Do not assume that strtok() leaves the parse string unchanged
Page:
FIO40-C. Reset strings on fgets() or fgetws() failure
Page:
INT13-C. Use bitwise operators only on unsigned operands
Page:
FIO21-C. Do not create temporary files in shared directories
Page:
INT32-C. Ensure that operations on signed integers do not result in overflow
Page:
FIO10-C. Take care when using the rename() function
Page:
EXP40-C. Do not modify constant objects
Page:
FLP36-C. Preserve precision when converting integral values to floating-point type
Page:
EXP02-C. Be aware of the short-circuit behavior of the logical AND and OR operators
Page:
FIO09-C. Be careful with binary data when transferring data across systems
Page:
DCL20-C. Explicitly specify void when a function accepts no arguments
Page:
EXP15-C. Do not place a semicolon on the same line as an if, for, or while statement
Page:
DCL07-C. Include the appropriate type information in function declarators
Page:
DCL03-C. Use a static assertion to test the value of a constant expression
Page:
PRE13-C. Use the Standard predefined macros to test for versions and features.
Page:
MSC33-C. Do not pass invalid data to the asctime() function
Page:
STR31-C. Guarantee that storage for strings has sufficient space for character data and the null terminator
Page:
MSC07-C. Detect and remove dead code
Page:
SIG35-C. Do not return from a computational exception signal handler
Page:
ERR06-C. Understand the termination behavior of assert() and abort()
Hierarchy
Parent Page
Page:
EE. Analyzers
Labels
There are no labels assigned to this page.
Recent Changes
Time
Editor
Oct 23, 2017 04:05
Liz Whiting
View Changes
LDRA version number updated
Apr 28, 2016 06:17
Liz Whiting
View Changes
Mar 24, 2016 11:49
Liz Whiting
View Changes
Aug 03, 2015 08:02
Liz Whiting
View Changes
LDRA version number
Sep 16, 2013 20:11
Robert Seacord
removed V
View Page History
Overview
Content Tools
{"serverDuration": 301, "requestCorrelationId": "c6a7c33259383581"}