- hw3/histogram.c:21: [5] (buffer) gets:
Does not check for buffer overflows (CWE-120, CWE-20). Use
fgets() instead.
gets(linebuf);
- hw3/print_errors.c:25: [4] (buffer) strcpy:
Does not check for buffer overflows when copying to destination (CWE-120).
Consider using strcpy_s, strncpy, or strlcpy (warning, strncpy is easily
misused).
strcpy(Usage, usage_mesg);
- hw3/print_errors.c:31: [4] (format) fprintf:
If format strings can be influenced by an attacker, they can be exploited
(CWE-134). Use
a constant for the format specification.
fprintf(stderr, Name);
- hw3/print_errors.c:52: [4] (format) fprintf:
If format strings can be influenced by an attacker, they can be exploited
(CWE-134). Use
a constant for the format specification.
fprintf(stderr, Name);
- hw3/print_errors.c:73: [4] (format) vfprintf:
If format strings can be influenced by an attacker, they can be exploited
(CWE-134). Use
a constant for the format specification.
vfprintf(stderr, fmt, args);
- hw3/print_errors.c:88: [4] (format) vfprintf:
If format strings can be influenced by an attacker, they can be exploited
(CWE-134). Use
a constant for the format specification.
vfprintf(stderr, fmt, args);
- hw3/print_errors.c:106: [4] (format) vfprintf:
If format strings can be influenced by an attacker, they can be exploited
(CWE-134). Use
a constant for the format specification.
vfprintf(stderr, fmt, args);
- hw3/print_errors.c:126: [4] (format) vfprintf:
If format strings can be influenced by an attacker, they can be exploited
(CWE-134). Use
a constant for the format specification.
vfprintf(stderr, fmt, args);
- hw3/prompt.c:29: [4] (buffer) strcpy:
Does not check for buffer overflows when copying to destination (CWE-120).
Consider using strcpy_s, strncpy, or strlcpy (warning, strncpy is easily
misused).
strcpy(prom, pstring);
- hw3/prompt.c:30: [4] (format) fprintf:
If format strings can be influenced by an attacker, they can be exploited
(CWE-134). Use
a constant for the format specification.
fprintf(promptf, prom);
- hw3/testfmt.c:3: [4] (format) printf:
If format strings can be influenced by an attacker, they can be exploited
(CWE-134). Use
a constant for the format specification.
printf(name);
- hw3/histogram.c:19: [2] (buffer) char:
Statically-sized arrays can be improperly restricted, leading to potential
overflows or other issues (CWE-119:CWE-120). Perform
bounds checking, use functions that limit length, or ensure that the size
is larger than the maximum possible length.
char linebuf[80];
- hw3/prompt.c:19: [2] (buffer) char:
Statically-sized arrays can be improperly restricted, leading to potential
overflows or other issues (CWE-119:CWE-120). Perform
bounds checking, use functions that limit length, or ensure that the size
is larger than the maximum possible length.
char prom[72];
- hw3/prompt.c:27: [2] (misc) fopen:
Check when opening files - can an attacker redirect it (via symlinks),
force the opening of special file type (e.g., device files), move things
around to create a race condition, control its ancestors, or change its
contents? (CWE-362).
promptf = fopen(ttyname(fileno(f)), "w");
- hw3/histogram.c:20: [1] (buffer) strcpy:
Does not check for buffer overflows when copying to destination (CWE-120).
Consider using strcpy_s, strncpy, or strlcpy (warning, strncpy is easily
misused). Risk is low because the source is a constant character.
strcpy(linebuf, "\n"); /* initialization */
- hw3/print_errors.c:24: [1] (buffer) strlen:
Does not handle strings that are not \0-terminated; if given one it may
perform an over-read (it could cause a crash if unprotected) (CWE-126).
Usage = (char *) malloc(strlen(usage_mesg));