Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Edited by sciSpider (sch jbop) (X_X)@==(Q_Q)@

...

Wiki Markup
Compiling at high warning levels in compliance with [MSC00-A. Compile cleanly at high warning levels] causes warnings to be issued when converting from {{unsigned char\[\]}} to {{char const char *}} when {{char}} is signed and from {{signed char\[\]}} to {{char const char *}} when {{char}} is defined to be unsigned.  Casts are required to eliminate these warnings, but excessive casts can make code difficult to read and hide legitimate warning messages.

Wiki Markup
If this C code were compiled using a C+\+ compiler, conversions from {{unsigned char\[\]}} to {{char const char *}} and from {{signed char\[\]}} to {{char const char *}} would be flagged as errors requiring casts.

...

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

STR04-A

1 ( low ) 1 (

unlikely )

2 ( medium )

P2

L3

Automated Detection

Fortify SCA Version 5.0 with CERT C Rule Pack can detect violations of this recommendation, except cases involving signed char.

...

STR03-A. Do not inadvertently truncate a nullNULL-terminated byte string      07. Characters and Strings (STR)       STR05-A. Use pointers to const when referring to string literals