...
| Code Block | ||
|---|---|---|
| ||
char buf[1024BUFSIZ + 1]; char *p; if (fgets(buf, sizeof(buf), fp) != NULL) { p if= strchr(buf[0] !=, '\0' && buf[strlen(buf) - 1] == '\n'n'); if (p) { buf[strlen(buf) - 1]*p = '\0'; } } else { /* handle error condition */ } |
Risk Assessment
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
FI037-C | 1 3 (lowhigh) | 1 (unlikely) | 3 2 (lowmedium) | P3 P6 | L3 |
References
- Lai 06
- Seacord 05 Chapter 2 Strings
- ISO/IEC 9899-1999 Section 7.19.7.2, "The fgets function"