HKMC C Secure Coding Standard for Automotive Development

Rule Checker name and description
HKMC C-ARR-001 (High): Ensure that the index is within the valid range for memory read and write operations of the array[AP,MCU]

ABV.ANY_SIZE_ARRAY  Buffer Overflow - Array Index Out of Bounds

ABV.GENERAL  Buffer Overflow - Array Index Out of Bounds

ABV.GENERAL.MULTIDIMENSION  Buffer Overflow - Array Index Out of Bounds

ABV.NON_ARRAY  Non-array object is used as an array

ABV.STACK  Buffer Overflow - Local Array Index Out of Bounds

ABV.TAINTED  Buffer Overflow from Unvalidated Input

ABV.UNICODE.BOUND_MAP  Buffer overflow in mapping character function

ABV.UNICODE.FAILED_MAP  Mapping function failed

ABV.UNICODE.NNTS_MAP  Buffer overflow in mapping character function

ABV.UNICODE.SELF_MAP  Mapping function failed

ABV.UNKNOWN_SIZE  Buffer Overflow - Array Index Out of Bounds

NNTS.MIGHT  Buffer Overflow - Non-null Terminated String

NNTS.MUST  Buffer Overflow - Non-null Terminated String

NNTS.TAINTED  Unvalidated User Input Causing Buffer Overflow - Non-Null Terminated String

SV.TAINTED.INDEX_ACCESS  Use of Unvalidated Integer as Array Index

SV.TAINTED.LOOP_BOUND  Use of Unvalidated Integer in Loop Condition

HKMC C-ARR-003 (Middle): Do not subtract or compare two pointers that do not reference the same array[AP, MCU]

MISRA.PTR.ARITH  Pointer is used in arithmetic or array index expression

HKMC C-ARR-004 (Middle): Do not add or subtract an integer to a pointer to a non-array object[AP, MCU]

MISRA.PTR.ARITH.2012  Pointer is used in arithmetic expression

HKMC C-ARR-006 (High): Do not add and subtract integers resized automatically in pointer[AP, MCU]

CERT.ARR.PTR.ARITH  Pointer is used in arithmetic expression

HKMC C-ARR-008 (High): Write before buffer start

ABV.ANY_SIZE_ARRAY  Buffer Overflow - Array Index Out of Bounds

ABV.GENERAL  Buffer Overflow - Array Index Out of Bounds

ABV.GENERAL.MULTIDIMENSION  Buffer Overflow - Array Index Out of Bounds

ABV.ITERATOR  Buffer Overflow - Array Index may be out of Bounds

ABV.MEMBER  Buffer Overflow - Array Index Out of Bounds

ABV.NON_ARRAY  Non-array object is used as an array

ABV.STACK  Buffer Overflow - Local Array Index Out of Bounds

ABV.TAINTED  Buffer Overflow from Unvalidated Input

ABV.UNICODE.BOUND_MAP  Buffer overflow in mapping character function

ABV.UNICODE.FAILED_MAP  Mapping function failed

ABV.UNICODE.NNTS_MAP  Buffer overflow in mapping character function

ABV.UNICODE.SELF_MAP  Mapping function failed

ABV.UNKNOWN_SIZE  Buffer Overflow - Array Index Out of Bounds

CXX.SUSPICIOUS_INDEX_CHECK  Suspicious use of index after boundary check

CXX.SUSPICIOUS_INDEX_CHECK.CALL  Suspicious use of index in a function call after a boundary check

CXX.SUSPICIOUS_INDEX_CHECK.ZERO  Suspicious use of index after index check for zero

RABV.CHECK  Suspicious use of index before boundary check

RN.INDEX  Suspicious use of index before negative check

SV.STRBO.BOUND_SPRINTF  Buffer Overflow in Bound sprintf

SV.STRBO.UNBOUND_SPRINTF  Buffer Overflow in Unbound sprintf

HKMC C-ARR-009 (Low): Buffer access using source buffer size

ABV.GENERAL  Buffer Overflow - Array Index Out of Bounds

ABV.GENERAL.MULTIDIMENSION  Buffer Overflow - Array Index Out of Bounds

ABV.ITERATOR  Buffer Overflow - Array Index may be out of Bounds

ABV.MEMBER  Buffer Overflow - Array Index Out of Bounds

ABV.NON_ARRAY  Non-array object is used as an array

ABV.STACK  Buffer Overflow - Local Array Index Out of Bounds

ABV.TAINTED  Buffer Overflow from Unvalidated Input

ABV.UNICODE.BOUND_MAP  Buffer overflow in mapping character function

ABV.UNICODE.FAILED_MAP  Mapping function failed

ABV.UNICODE.NNTS_MAP  Buffer overflow in mapping character function

ABV.UNICODE.SELF_MAP  Mapping function failed

HKMC C-ARR-010 (Middle): Attention not to include invalid arguments when calling a function[MCU]

MISRA.FUNC.UNMATCHED.PARAMS  Number of formal and actual parameters passed to function do not match

SV.FMT_STR.PRINT_FORMAT_MISMATCH.BAD  Incompatible type of a print function parameter

SV.FMT_STR.PRINT_FORMAT_MISMATCH.UNDESIRED  Unexpected type of a print function parameter

SV.FMT_STR.SCAN_FORMAT_MISMATCH.BAD  Incompatible type of a scan function parameter

SV.FMT_STR.SCAN_FORMAT_MISMATCH.UNDESIRED  Unexpected type of a scan function parameter

SV.FMT_STR.SCAN_PARAMS_WRONGNUM.FEW  Too few arguments in a scan function call

SV.FMT_STR.SCAN_PARAMS_WRONGNUM.MANY  Too many arguments in a scan function call

HKMC C-ARR-011 (High): Attention for incorrect judgement of return value by function

SV.RVT.RETVAL_NOTTESTED  Ignored Return Value

HKMC C-CON-004 (Middle): Avoid race conditions when using library functions

CERT.CONC.LIB_FUNC_USE  Avoid race conditions when using library functions

HKMC C-CON-006 (Low): Lock according to predefine order to avoid deadlock

CONC.DL  Deadlock

HKMC C-CON-007 (Low): Wrapping of functions that can spuriously wake up in a loop

CERT.CONC.WAKE_IN_LOOP_C  Wrap functions that can spuriously wake up in a loop

HKMC C-CON-008 (Low): Do not call signal() in a multithreaded program

MISRA.STDLIB.SIGNAL  Use of the signal handling facilities of signal.h

HKMC C-CON-009 (Low): Preserve thread safety and liveness when using condition variables

CERT.CONC.UNSAFE_COND_VAR_C  Preserve thread safety and liveness when using condition variables

HKMC C-CON-011 (Middle): Do not reference to an atomic variable twice in an expression

CERT.CONC.ATOMIC_TWICE_EXPR  Do not refer to an atomic variable twice in an expression

HKMC C-DCI-001 (High): Do not returning and assigning local variable address

LOCRET.ARG  Function returns address of local variable

LOCRET.GLOB  Function returns address of local variable

LOCRET.RET  Function returns address of local variable

HKMC C-DCI-002 (Middle): Do not declare same variable for internal and external linkage

MISRA.FUNC.STATIC.REDECL  Function or object redeclaration does not include 'static' modifier

HKMC C-DCI-003 (Low): Do not declare or define a reserved identifier

MISRA.DEFINE.WRONGNAME.UNDERSCORE  Usage of a reserved name for naming a macro

MISRA.STDLIB.WRONGNAME  Reused name of standard library macro, object or function

MISRA.STDLIB.WRONGNAME.UNDERSCORE  Usage of a reserved name for naming a language entity

HKMC C-DCI-004 (Low): Need to use the correct syntax when declaring a flexible array

CERT.STRUCT.FLEXIBLE_ARRAY_MEMBER  Use the correct syntax when declaring a flexible array member

HKMC C-DCI-005 (Low): Need to avoid information leakage when passing a structure across a trust boundary

PORTING.STORAGE.STRUCT  Byte position of elements in a structure could depend on alignment and packing attributes.

HKMC C-DCI-006 (Low): Do not declare of incompatible function or object

MISRA.FUNC.NOPROT.DEF.2012  Function has a definition but no prototype

MISRA.FUNC.PARAMS.IDENT  Identifiers used in declaration and definition of function are not identical

HKMC C-DCI-007 (Middle): Do not declare variable in a switch statement before the first case label

CERT.DCL.SWITCH.VAR_BEFORE_CASE  Do not declare variables inside a switch statement before the first case label

HKMC C-DCI-009 (Middle): Do not miss default case in switch statement

MISRA.SWITCH.NODEFAULT  No default clause at the end of a switch statement

HKMC C-DCI-010 (Middle): Do not omit break in switch statement

MISRA.SWITCH.NO_BREAK  No break or throw statement at the end of switch-clause

HKMC C-DCI-011 (High): Need explicit handling of operator precedence using parentheses

MISRA.EXPR.PARENS.2012  The precedence of operators within expressions should be made explicit.

MISRA.EXPR.PARENS.INSUFFICIENT  Limited dependence required for operator precedence rules in expressions

HKMC C-DCI-012 (High): Do not compare numerical ranges without minimum check

RN.INDEX  Suspicious use of index before negative check

HKMC C-ENV-001 (Low): Do not modify the object referenced by the return value of certain functions

MISRA.STDLIB.CTYPE.RANGE.2012_AMD1  Any value passed to a function in ctype.h shall be representable as an unsigned char or be the value EOF

MISRA.STDLIB.ILLEGAL_REUSE.2012_AMD1  The pointer returned by the Standard Library functions asctime and similar shall not be used following a subsequent call to the same function

MISRA.STDLIB.ILLEGAL_WRITE.2012_AMD1  The pointers returned by the Standard Library functions localeconv, getenv, setlocale or, strerror shall only be used as if they have pointer to const-qualified type

HKMC C-ENV-003 (Middle): All exit handlers must return normally

CERT.EXIT.HANDLER_TERMINATE  All exit handlers must return normally

HKMC C-ENV-004 (High): Do not call system()

MISRA.STDLIB.SYSTEM.2012_AMD2  Use of 'system' from library stdlib.h

HKMC C-ERR-001 (Middle): Attention when calling a library related the errno

CXX.ERRNO.INCORRECTLY_CHECKED  Errno condition check not required after calling library function

CXX.ERRNO.NOT_CHECKED  Errno condition check is missing after calling library function

CXX.ERRNO.NOT_SET  Errno is not reset to zero before calling library function

HKMC C-ERR-002 (High): Detect and handle errors of standard library

SV.RVT.RETVAL_NOTTESTED  Ignored Return Value

HKMC C-ERR-003 (Middle): Detect errors when converting a string to a number

MISRA.STDLIB.ATOI  Use of 'atof', 'atoi' or 'atol' from library stdlib.h

HKMC C-EXP-001 (Middle): Do not ignore return value by functions

MISRA.FUNC.UNUSEDRET.2012  The return value of a non-void function shall be used.

SV.RVT.RETVAL_NOTTESTED  Ignored Return Value

HKMC C-EXP-002 (Middle): Attention to the order of calculation(evaluation) that causes the side effects

MISRA.INCR_DECR.OTHER  Increment or decrement operator is mixed with other operators in expression

MISRA.INCR_DECR.SIDEEFF.2012  A full expression containing an increment (++) or decrement (--) operator should have no other potential side effects other than that caused by the increment or decrement operator

MISRA.LOGIC.SIDEEFF  Right operand in a logical 'and' or 'or' expression contains side effects

MISRA.SHIFT.RANGE.2012  Right operand of shift operation is out of range - greater or equal to the essential type size of left operand, or is negative

PORTING.VAR.EFFECTS  Variable used twice in one expression where one usage is subject to side-effects

HKMC C-EXP-003 (High): Do not reference(access, read) uninitialized memory

UNINIT.HEAP.MIGHT  Uninitialized Heap Use - possible

UNINIT.HEAP.MUST  Uninitialized Heap Use

UNINIT.STACK.ARRAY.MIGHT  Uninitialized Array - possible

UNINIT.STACK.ARRAY.MUST  Uninitialized Array

UNINIT.STACK.ARRAY.PARTIAL.MUST  Partially Uninitialized Array

UNINIT.STACK.MIGHT  Uninitialized Variable - possible

UNINIT.STACK.MUST  Uninitialized Variable

HKMC C-EXP-004 (Middle): Attention not to reference abnormal pointer

SV.TAINTED.CALL.DEREF  Dereference Of An Unvalidated Pointer

SV.TAINTED.DEREF  Dereference Of An Unvalidated Pointer

HKMC C-EXP-005 (Low): Attention when using assignment operator instead of comparison operators

ASSIGCOND.CALL  Assignment in condition (call)

ASSIGCOND.GEN  Assignment in condition

HKMC C-EXP-006 (Middle): Attention when using comparison operators instead of assignment operators

EFFECT  Statement has no effect

HKMC C-EXP-007 (High): Attention to external input not checked for the control condition of the loop

SV.TAINTED.CALL.LOOP_BOUND  Use of Unvalidated Integer in Loop Condition through a Function Call

SV.TAINTED.LOOP_BOUND  Use of Unvalidated Integer in Loop Condition

HKMC C-EXP-009 (High): Do not null pointer dereference

NPD.CHECK.CALL.MIGHT  Pointer may be passed to function that can dereference it after it was positively checked for NULL

NPD.CHECK.CALL.MUST  Pointer will be passed to function that may dereference it after it was positively checked for NULL

NPD.CHECK.MIGHT  Pointer may be dereferenced after it was positively checked for NULL

NPD.CHECK.MUST  Pointer will be dereferenced after it was positively checked for NULL

NPD.CONST.CALL  NULL is passed to function that can dereference it

NPD.CONST.DEREF  NULL is dereferenced

NPD.FUNC.CALL.MIGHT  Result of function that may return NULL may be passed to another function that may dereference it

NPD.FUNC.CALL.MUST  Result of function that may return NULL will be passed to another function that may dereference it

NPD.FUNC.MIGHT  Result of function that can return NULL may be dereferenced

NPD.FUNC.MUST  Result of function that may return NULL will be dereferenced

NPD.GEN.CALL.MIGHT  Null pointer may be passed to function that may dereference it

NPD.GEN.CALL.MUST  Null pointer will be passed to function that may dereference it

NPD.GEN.MIGHT  Null pointer may be dereferenced

NPD.GEN.MUST  Null pointer will be dereferenced

RNPD.CALL  Suspicious dereference of pointer in function call before NULL check

RNPD.DEREF  Suspicious dereference of pointer before NULL check

HKMC C-EXP-010 (Low): Do not cast pointer into more strictly aligned pointer types

MISRA.CAST.OBJ_PTR_TO_OBJ_PTR.2012  Cast between a pointer to object type and a pointer to a different object type

MISRA.CAST.PTR.UNRELATED  Object of pointer type cast to unrelated type

MISRA.CAST.PTR_TO_INT  Cast between a pointer and an integral type

PORTING.CAST.PTR  Cast between types that are not both pointers or not pointers

PORTING.CAST.PTR.FLTPNT  Cast of a pointer to a floating point expression to a non floating point type pointer

PORTING.CAST.PTR.SIZE  Attempt to cast an expression to a type of a potentially incompatible size

HKMC C-EXP-011 (Middle): Do not variable access through pointers of incompatible types

MISRA.CAST.FUNC_PTR.2012  Conversion performed between a pointer to a function and another incompatible type

MISRA.CAST.INCOMPLETE_PTR_TO_ANY.2012  Conversion performed between a pointer to an incomplete type and a different type

MISRA.CAST.OBJ_PTR_TO_NON_INT.2012  A cast between a pointer to object and a non-integer arithmetic type

MISRA.CAST.OBJ_PTR_TO_OBJ_PTR.2012  Cast between a pointer to object type and a pointer to a different object type

HKMC C-EXP-012 (Low): Do not modify constant object

CERT.STR.ARG.CONST_TO_NONCONST  Do not pass a const char pointer to a non-const char pointer argument

CERT.STR.ASSIGN.CONST_TO_NONCONST  Do not assign a const char pointer to a non-const char pointer

HKMC C-EXP-013 (Middle): Do not compare padding data

CERT.MEMCMP.PADDED_DATA  Do not compare padding data

HKMC C-EXP-014 (Middle): Attention to avoid undefined behavior when using a pointer that qualifies restrict

MISRA.TYPE.RESTRICT.QUAL.2012  The restrict type qualifier shall not be used

HKMC C-EXP-015 (Low): Do not pass an expression that changes the value of variable as an operand to sizeof, _Alignof, _Generic

MISRA.SIZEOF.SIDE_EFFECT  Operand of sizeof has side effects

HKMC C-EXP-016 (Low): Do not perform assignment operation on certain operators

ASSIGCOND.CALL  Assignment in condition (call)

ASSIGCOND.GEN  Assignment in condition

MISRA.ASSIGN.COND  Assignment operator is used in a condition

HKMC C-EXP-017 (Low): Do not use a bitwise operator with Boolean operand

MISRA.LOGIC.OPERATOR.NOT_BOOL  Operand of non-logical operator is effectively boolean

HKMC C-FIO-001 (High): Exclude user input from format strings

SV.TAINTED.FMTSTR  Use of Unvalidated Data in a Format String

HKMC C-FIO-002 (High): Distinguish between characters read from a file and EOF or WEOF

CWARN.CMPCHR.EOF  A 'char' expression compared with EOF constant

HKMC C-FIO-005 (Low): Reset strings on fgets() or fgetws() failure

CERT.FIO.RESET  Reset strings on fgets() or fgetws() failure

HKMC C-FIO-007 (Middle): Close file when they are no longer needed

RH.LEAK  Resource leak

HKMC C-FIO-008 (High): Use valid format strings

SV.FMT_STR.PRINT_FORMAT_MISMATCH.BAD  Incompatible type of a print function parameter

SV.FMT_STR.PRINT_FORMAT_MISMATCH.UNDESIRED  Unexpected type of a print function parameter

SV.FMT_STR.PRINT_IMPROP_LENGTH  Improper use of length modifier in a print function call

SV.FMT_STR.PRINT_PARAMS_WRONGNUM.FEW  Too few arguments in a print function call

SV.FMT_STR.PRINT_PARAMS_WRONGNUM.MANY  Too many arguments in a print function call

SV.FMT_STR.SCAN_FORMAT_MISMATCH.BAD  Incompatible type of a scan function parameter

SV.FMT_STR.SCAN_FORMAT_MISMATCH.UNDESIRED  Unexpected type of a scan function parameter

SV.FMT_STR.SCAN_IMPROP_LENGTH  Improper use of length modifier in a scan function call

SV.FMT_STR.SCAN_PARAMS_WRONGNUM.FEW  Too few arguments in a scan function call

SV.FMT_STR.SCAN_PARAMS_WRONGNUM.MANY  Too many arguments in a scan function call

SV.FMT_STR.UNKWN_FORMAT  Unknown format specifier in a print function call

HKMC C-FIO-009 (Low): Do not concurrent execution using shared resource with improper synchronization(Race condition)

SV.TOCTOU.FILE_ACCESS  Time of Creation/Time of Use Race condition in File Access

HKMC C-FLP-001 (High): Do not use floating-point variables as loop counters

MISRA.FOR.COUNTER.FLT  For loop counter has a floating point type

HKMC C-FLP-002 (Low): Ensure that floating-point type conversion occurs within the range of new types

MISRA.CAST.FLOAT.WIDER  Cast of floating point expression to a wider floating point type

MISRA.CAST.FLOAT_INT  Cast of floating point expression to integral type

MISRA.CAST.INT_FLOAT  Cast of integral expression to floating point type

MISRA.CONV.FLOAT  Implicit floating-point conversion

HKMC C-FLP-003 (Low): Preserve precision when converting from integer type to floating-point type

PORTING.CAST.FLTPNT  Cast of a floating point expression to a non floating point type

HKMC C-INT-001 (Middle): Attention to integer conversion rules(CERT recommendations)

MISRA.CAST.INT  Non-trivial integer expression is cast to a wider type, or type with a different signedness

MISRA.CAST.UNSIGNED_BITS  The result of bitwise operation on unsigned char or short is not cast back to original type

MISRA.CONV.INT.SIGN  Implicit integral conversion changes signedness

MISRA.CVALUE.IMPL.CAST  The value of an expression implicitly converted to a different type

MISRA.UMINUS.UNSIGNED  Operand of unary minus is unsigned

PRECISION.LOSS  Loss of Precision

HKMC C-INT-002 (High): Ensure that unsigned integer operations do not wrap

NUM.OVERFLOW.DF  Possible numeric overflow or wraparound

HKMC C-INT-003 (High): Integer conversion must be guaranteed not to result in lost or misinterpreted data

PRECISION.LOSS  Loss of Precision

PRECISION.LOSS.CALL  Loss of Precision during function call

HKMC C-INT-004 (High): Ensure that signed integer operations do not overflow

CWARN.NOEFFECT.OUTOFRANGE  Value outside of range

NUM.OVERFLOW.DF  Possible numeric overflow or wraparound

HKMC C-INT-005 (Low): Ensure that division and modulo operations do not result in 'divide-by-zero' errors

DBZ.CONST  Division by a zero constant occurs

DBZ.CONST.CALL  The value '0' is passed to function that can use this value as divisor

DBZ.GENERAL  Division by zero might occur

DBZ.GENERAL.FLOAT  Division by floating-point zero might occur

DBZ.ITERATOR  Division by zero might occur in a loop iterator

DBZ.ITERATOR.CALL  Division by zero might occur in a function call

DBZ.ITERATOR.FLOAT  Division by zero might occur in a loop iterator

HKMC C-INT-006 (Low): Do not shift to negative values or shift by more than or equal to the bits of operands

MISRA.SHIFT.RANGE.2012  Right operand of shift operation is out of range - greater or equal to the essential type size of left operand, or is negative

HKMC C-INT-007 (Low): Use the correct precisions of integer type

NUM.OVERFLOW  Possible Overflow

NUM.OVERFLOW.DF  Possible numeric overflow or wraparound

HKMC C-INT-008 (Low): Attention to type conversion between pointer and integer

MISRA.CAST.OBJ_PTR_TO_INT.2012  Conversion performed between a pointer to an object and an integer type

HKMC C-INT-009 (Middle): Attention to calculate for buffer or data type size

CXX.SIZEOF.CSTRING  Use of sizeof on char* may be misleading

INCORRECT.ALLOC_SIZE  Incorrect Allocation Size

HKMC C-MEM-001 (High): Do not reference freed memory

UFM.DEREF.MIGHT  Use of free memory (access) - possible

UFM.DEREF.MUST  Use of Freed Memory by Pointer

UFM.FFM.MIGHT  Use of free memory (double free) - possible

UFM.FFM.MUST  Freeing Freed Memory

UFM.RETURN.MIGHT  Use of freed memory (return) - possible

UFM.RETURN.MUST  Use of Freed Memory on Return

UFM.USE.MIGHT  Use of free memory - possible

UFM.USE.MUST  Use of Freed Memory

HKMC C-MEM-002 (Middle): Free dynamically allocated memory when no longer needed

CL.FFM.ASSIGN  Use of free memory (double free) - no operator=

CL.FFM.COPY  Use of free memory (double free) - no copy constructor

MLK.MIGHT  Memory Leak - possible

MLK.MUST  Memory Leak

MLK.RET.MIGHT  Memory Leak - possible

MLK.RET.MUST  Memory Leak

HKMC C-MEM-004 (High): Free memory allocated dynamically

MLK.MIGHT  Memory Leak - possible

MLK.MUST  Memory Leak

MLK.RET.MIGHT  Memory Leak - possible

MLK.RET.MUST  Memory Leak

HKMC C-MEM-005 (High): Allocate sufficient memory for an object

INCORRECT.ALLOC_SIZE  Incorrect Allocation Size

SV.TAINTED.ALLOC_SIZE  Use of Unvalidated Integer in Memory Allocation

HKMC C-MEM-007 (Middle): Improper clearing of heap memory before release('Heap inspection')

CXX.REALLOC  Use of realloc() should be avoided

HKMC C-MSC-003 (Middle): Do not use the rand() when generating random number using PRNG

CERT.MSC.STD_RAND_CALL  Do not use std::rand() for generating pseudorandom numbers

HKMC C-MSC-004 (Middle): Set seeds correctly when using PRNG

CERT.MSC.SEED_RANDOM  Properly seed pseudorandom number generators

HKMC C-MSC-005 (High): Attention to pass improper argument when using the asctime()

CERT.MSC.ASCTIME  Do not pass invalid data to the asctime() function

HKMC C-MSC-006 (High): Return all functions other than void return type

FUNCRET.GEN  Non-void function does not return value

FUNCRET.IMPLICIT  Non-void function implicitly returning int does not return value

HKMC C-MSC-008 (Low): Do not call va_arg with an argument of the incorrect type

VA.LIST.INDETERMINATE  Attempt to call va_arg() on a va_list that has an indeterminate value

HKMC C-MSC-010 (Middle): Do not use getlogin in multithreaded applications

CXX.GETLOGIN  Do not use getlogin in multithreaded applications

HKMC C-MSC-013 (N/A): Satisfy a certain level of security when using cryptographic algorithms or hash functions

RCA  Risky cryptographic algorithm used

HKMC C-MSC-014 (High): Do not use algorithms that find security vulnerabilities such as the DES symmetric key algorithm and the MD5 hash algorithm[MCU]

SV.WEAK_CRYPTO.WEAK_HASH  Weak Hash Function

HKMC C-MSC-015 (High): Do not use fixed or predictable seeds[MCU]

CERT.MSC.SEED_RANDOM  Properly seed pseudorandom number generators

HKMC C-POS-002 (Low): Do not use for vfork()

CXX.POSIX.VFORK  Do not use vfork()

HKMC C-POS-003 (High): Do not pass a pointer to a local variable in the putenv()

CERT.PUTENV.AUTO_VARIABLE  Do not call putenv() with a pointer to an automatic variable as the argument

CXX.PUTENV.LOCAL.PTR  Do not pass a pointer to a local variable in the putenv()

HKMC C-POS-005 (Middle): Use of correct byte order is required for data communication between systems

BYTEORDER.HTON.SEND  Missed conversion from host to network byte order

BYTEORDER.HTON.WRITE  Missed conversion from host to network byte order

BYTEORDER.NTOH.READ  Missed conversion from network to host byte order

BYTEORDER.NTOH.RECV  Missed conversion from network to host byte order

HKMC C-POS-006 (Low): Do not use signals to terminate threads

MISRA.INCL.SIGNAL.2012  The standard header file signal.h shall not be used

HKMC C-POS-008 (High): Detect and handle POSIX library errors

SV.RVT.RETVAL_NOTTESTED  Ignored Return Value

HKMC C-POS-009 (High): Attention improper resource locking

CONC.DBL_LOCK  Double Lock

CONC.DBL_UNLOCK  Double Unlock

CONC.DL  Deadlock

CONC.NO_UNLOCK  Missing unlock for variable

HKMC C-POS-011 (Middle): Clear block delimitation of the statements[MCU]

MISRA.IF.NO_COMPOUND  The body of if/else statement is not a compound statement

HKMC C-POS-012 (Middle): Remove 'Dead code'[MCU]

CWARN.NOEFFECT.SELF_ASSIGN  A variable is assigned to self

CWARN.NOEFFECT.UCMP.GE  Comparison of unsigned value against 0 is always true

CWARN.NOEFFECT.UCMP.GE.MACRO  Comparison of unsigned value against 0 within a macro is always true

CWARN.NOEFFECT.UCMP.LT  Comparison of unsigned value against 0 is always false

CWARN.NOEFFECT.UCMP.LT.MACRO  Comparison of unsigned value against 0 within a macro is always false

CWARN.NULLCHECK.FUNCNAME  Function address was directly compared against 0

EFFECT  Statement has no effect

INVARIANT_CONDITION.GEN  Invariant expression in a condition

INVARIANT_CONDITION.UNREACH  Invariant expression in a condition

LA_UNUSED  Label unused

MISRA.STMT.NO_EFFECT  The statement has no side effects, and does not change control flow

UNREACH.GEN  Unreachable code

UNREACH.RETURN  Unreachable Void Return

UNREACH.SIZEOF  Architecture-related unreachable code

VA_UNUSED.GEN  Value is Never Used after Assignment

VA_UNUSED.INIT  Value is Never Used after Initialization

HKMC C-PRE-002 (Low): Do not pass specific variable value conversion argument to unsafe macros

PORTING.VAR.EFFECTS  Variable used twice in one expression where one usage is subject to side-effects

HKMC C-PRE-003 (Low): Do not pass preprocessing directives in when calling function-like macros

MISRA.EXPANSION.DIRECTIVE  Directive-like tokens within a macro argument

HKMC C-STR-001 (Low): Do not modify string literals

CERT.STR.ARG.CONST_TO_NONCONST  Do not pass a const char pointer to a non-const char pointer argument

CERT.STR.ASSIGN.CONST_TO_NONCONST  Do not assign a const char pointer to a non-const char pointer

HKMC C-STR-002 (High): Ensure that storage has sufficiently space for character data and the null terminator

NNTS.MIGHT  Buffer Overflow - Non-null Terminated String

NNTS.MUST  Buffer Overflow - Non-null Terminated String

SV.FMT_STR.BAD_SCAN_FORMAT  Input format specifier error

SV.UNBOUND_STRING_INPUT.FUNC  Usage of unbounded string input

HKMC C-STR-003 (High): Do not passing a non-null-terminated string to a library function

NNTS.MIGHT  Buffer Overflow - Non-null Terminated String

NNTS.MUST  Buffer Overflow - Non-null Terminated String

NNTS.TAINTED  Unvalidated User Input Causing Buffer Overflow - Non-Null Terminated String

SV.STRBO.BOUND_COPY.UNTERM  Possible Buffer Overflow in Following String Operations

HKMC C-STR-004 (Low): Argument to character-handling function must be passed as unsigned char

AUTOSAR.STDLIB.CCTYPE.UCHAR  Arguments to character-handling functions defined in <cctype> shall be representable as an unsigned char

MISRA.ETYPE.ASSIGN.2012  Assignment to an object of a narrower essential type or a different essential type category

HKMC C-STR-005 (High): Do not confuse narrow and wide character strings when passing arguments to character-handling function

CXX.DIFF.WIDTH.STR_AND_FUNC  Implicit cast between narrow and wide character string while calling function

HKMC C-STR-006 (Low): Incorrect calculation of the multi-byte string length

CXX.MALLOC.WCHAR_LENGTH  Use (wsclen()+1*sizeof(wchar_t)) when allocating memory with malloc for wchar_t buffers