Versions Compared

Key

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

...

Code Block
bgColor#FFcccc
size_t count_whitespace(char const char *s) {
  char const char *t = s;
  while (isspace(*t))  /* possibly *t < 0 */
    ++t;
  return t - s;
}

...

Code Block
bgColor#ccccff
size_t count_whitespace(const unsigned *s) {
  const unsigned char *t = s;
  while (isspace(*t))
    ++t;
  return t - s;
}

...

Code Block
bgColor#ccccff
size_t count_whitespace(char const char *s) {
  char const char *t = s;
  while (isspace((unsigned char)*t))
    ++t;
  return t - s;
}

...

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

INT37-C

1 (low)

1 (unlikely)

3 (low)

P3

L3

Related Vulnerabilities

Search for Examples of vulnerabilities resulting from the violation of this rule can be found on the CERT website.

References

Wiki Markup
\[[ISO/IEC 9899-1999|AA. C References#ISO/IEC 9899-1999]] Section 7.4, "Character handling <ctype.h>"
\[[Kettlewell 02|AA. C References#Kettle 02]] Section 1.1, "<ctype.h> And Characters Types"