Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This non-compliant code example is intended to be used to remove the trailing newline (\n) from an input line.

Code Block
bgColor#F7D6C1#FFCCCC
char buf[1024];

fgets(buf, sizeof(buf), fp);
buf[strlen(buf) - 1] = '\0';

...

Code Block
bgColor#ccccff
char buf[1024];

if (fgets(buf, sizeof(buf), fp))
{
  char *p;
  if (p=strchr(buf, '\n'))
    *p = 0;
}

Priority and Level

Risk Assessment

L3

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

EXP01-A

Component

Value

Severity

1 (low)

Likelihood

1 (unlikely)

3 1 (low)

Remediation cost

2 (medium)

Priority

P2

Level

P3

P3

References