Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler.
Number of rules (primarily dangerous function names) in C/C++ ruleset: 223
Examining data/postmark-1.53/postmark-1.53.c

FINAL RESULTS:

data/postmark-1.53/postmark-1.53.c:174:15:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
   file_entry system;
data/postmark-1.53/postmark-1.53.c:308:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(new_file_system->system.name,params);
data/postmark-1.53/postmark-1.53.c:308:31:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      strcpy(new_file_system->system.name,params);
data/postmark-1.53/postmark-1.53.c:309:24:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      new_file_system->system.size=weight;
data/postmark-1.53/postmark-1.53.c:334:29:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      if (!strcmp(traverse->system.name,loc_name))
data/postmark-1.53/postmark-1.53.c:336:40:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
         file_system_weight-=traverse->system.size;
data/postmark-1.53/postmark-1.53.c:659:7:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
      strcat(dest,
data/postmark-1.53/postmark-1.53.c:661:7:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
      strcat(dest,SEPARATOR);
data/postmark-1.53/postmark-1.53.c:666:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(conversion,"s%d%s",RND(subdirectories),SEPARATOR);
data/postmark-1.53/postmark-1.53.c:667:7:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
      strcat(dest,conversion);
data/postmark-1.53/postmark-1.53.c:671:4:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
   strcat(dest,conversion);
data/postmark-1.53/postmark-1.53.c:881:36:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
         for (count=0; count<list->system.size; count++)
data/postmark-1.53/postmark-1.53.c:882:30:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
            index[i++]=list->system.name;
data/postmark-1.53/postmark-1.53.c:899:47:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
         create_subdirectories(NULL,dir_list->system.name,subdirs);
data/postmark-1.53/postmark-1.53.c:904:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
         sprintf(save_dir,"%s%s",base_dir,SEPARATOR);
data/postmark-1.53/postmark-1.53.c:910:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
         sprintf(dir_name,"%ss%d",save_dir,i);
data/postmark-1.53/postmark-1.53.c:928:47:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
         delete_subdirectories(NULL,dir_list->system.name,subdirs);
data/postmark-1.53/postmark-1.53.c:933:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
         sprintf(save_dir,"%s%s",base_dir,SEPARATOR);
data/postmark-1.53/postmark-1.53.c:939:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
         sprintf(dir_name,"%ss%d",save_dir,i);
data/postmark-1.53/postmark-1.53.c:1094:45:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      printf("\t%s (weight=%d)\n",traverse->system.name,traverse->system.size);
data/postmark-1.53/postmark-1.53.c:1094:67:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      printf("\t%s (weight=%d)\n",traverse->system.name,traverse->system.size);
data/postmark-1.53/postmark-1.53.c:1175:7:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      system((strlen(buffer)>1)?buffer+1:getenv("SHELL"));
data/postmark-1.53/postmark-1.53.c:73:14:  [3] (buffer) getwd:
  This does not protect against buffer overflows by itself, so use with
  caution (CWE-120, CWE-20). Use getcwd instead.
extern char *getwd();
data/postmark-1.53/postmark-1.53.c:75:18:  [3] (buffer) getwd:
  This does not protect against buffer overflows by itself, so use with
  caution (CWE-120, CWE-20). Use getcwd instead.
#define GETWD(x) getwd(x)
data/postmark-1.53/postmark-1.53.c:1175:42:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
      system((strlen(buffer)>1)?buffer+1:getenv("SHELL"));
data/postmark-1.53/postmark-1.53.c:166:4:  [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 name[MAX_FILENAME+1]; /* name of individual file */
data/postmark-1.53/postmark-1.53.c:193:11:  [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.
   static char buffer[MAX_LINE]; /* storage for current conversion */
data/postmark-1.53/postmark-1.53.c:196:7:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
      sprintf(buffer,"%.2f megabytes",(float)i/MEGABYTE);
data/postmark-1.53/postmark-1.53.c:199:10:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
         sprintf(buffer,"%.2f kilobytes",(float)i/KILOBYTE);
data/postmark-1.53/postmark-1.53.c:201:10:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
         sprintf(buffer,"%d bytes",i);
data/postmark-1.53/postmark-1.53.c:210:11:  [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.
   static char buffer[MAX_LINE]; /* storage for current conversion */
data/postmark-1.53/postmark-1.53.c:213:7:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
      sprintf(buffer,"%.2f megabytes",i/(float)MEGABYTE);
data/postmark-1.53/postmark-1.53.c:216:10:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
         sprintf(buffer,"%.2f kilobytes",i/(float)KILOBYTE);
data/postmark-1.53/postmark-1.53.c:218:10:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
         sprintf(buffer,"%f bytes",i);
data/postmark-1.53/postmark-1.53.c:230:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
   if (param && (size=atoi(param))>0)
data/postmark-1.53/postmark-1.53.c:233:46:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      if ((token=strchr(param,' ')) && (size=atoi(token))>0 &&
data/postmark-1.53/postmark-1.53.c:252:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
   if (param && (value=atoi(param))>0)
data/postmark-1.53/postmark-1.53.c:290:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      if ((weight=atoi(split+1))<=0)
data/postmark-1.53/postmark-1.53.c:450:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
   if (param && (value=atoi(param))>=-1 && value<=10)
data/postmark-1.53/postmark-1.53.c:465:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
   if (param && (value=atoi(param))>=-1 && value<=10)
data/postmark-1.53/postmark-1.53.c:654:4:  [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 conversion[MAX_LINE+1];
data/postmark-1.53/postmark-1.53.c:670:4:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
   sprintf(conversion,"%d",++files_created);
data/postmark-1.53/postmark-1.53.c:690:13:  [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).
         fp=fopen(file_table[free_file].name,"w");
data/postmark-1.53/postmark-1.53.c:692:13:  [2] (misc) open:
  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).
         fd=open(file_table[free_file].name,O_RDWR|O_CREAT,0644);
data/postmark-1.53/postmark-1.53.c:733:10:  [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).
      fp=fopen(file_table[number].name,"r");
data/postmark-1.53/postmark-1.53.c:735:10:  [2] (misc) open:
  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).
      fd=open(file_table[number].name,O_RDONLY,0644);
data/postmark-1.53/postmark-1.53.c:779:13:  [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).
         fp=fopen(file_table[number].name,"a");
data/postmark-1.53/postmark-1.53.c:781:13:  [2] (misc) open:
  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).
         fd=open(file_table[number].name,O_RDWR|O_APPEND,0644);
data/postmark-1.53/postmark-1.53.c:892:4:  [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 dir_name[MAX_LINE+1]; /* buffer holding subdirectory names */
data/postmark-1.53/postmark-1.53.c:893:4:  [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 save_dir[MAX_LINE+1];
data/postmark-1.53/postmark-1.53.c:921:4:  [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 dir_name[MAX_LINE+1]; /* buffer holding subdirectory names */
data/postmark-1.53/postmark-1.53.c:922:4:  [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 save_dir[MAX_LINE+1];
data/postmark-1.53/postmark-1.53.c:1028:15:  [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).
      if ((fp=fopen(param,"a"))==NULL)
data/postmark-1.53/postmark-1.53.c:1053:4:  [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 buffer[MAX_LINE+1]; /* storage for input command line */
data/postmark-1.53/postmark-1.53.c:1067:4:  [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 current_dir[MAX_LINE+1]; /* buffer containing working directory */
data/postmark-1.53/postmark-1.53.c:1072:15:  [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).
      if ((fp=fopen(param,"a"))==NULL)
data/postmark-1.53/postmark-1.53.c:1158:10:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
         strcpy(buffer,"help");
data/postmark-1.53/postmark-1.53.c:1160:10:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
         strcpy(buffer,"quit");
data/postmark-1.53/postmark-1.53.c:1204:11:  [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).
   if (fp=fopen(filename,"r")) /* open config file */
data/postmark-1.53/postmark-1.53.c:1228:4:  [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 buffer[MAX_LINE+1]; /* storage for input command line */
data/postmark-1.53/postmark-1.53.c:751:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            read(fd,read_buffer,read_block_size);
data/postmark-1.53/postmark-1.53.c:753:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         read(fd,read_buffer,i);
data/postmark-1.53/postmark-1.53.c:1130:22:  [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).
   if (param && (len=strlen(param))>0) /* if a command is specified... */
data/postmark-1.53/postmark-1.53.c:1156:14:  [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).
      buffer[strlen(buffer)-1]='\0';    /* delete final CR */
data/postmark-1.53/postmark-1.53.c:1175:15:  [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).
      system((strlen(buffer)>1)?buffer+1:getenv("SHELL"));
data/postmark-1.53/postmark-1.53.c:1180:17:  [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).
            len=strlen(command_list[i].name)))
data/postmark-1.53/postmark-1.53.c:1183:23:  [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).
               (((int)strlen(buffer)>len)?buffer+len+1:NULL);
data/postmark-1.53/postmark-1.53.c:1209:17:  [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).
         buffer[strlen(buffer)-1]='\0'; /* delete final CR */

ANALYSIS SUMMARY:

Hits = 68
Lines analyzed = 1493 in approximately 0.13 seconds (11283 lines/second)
Physical Source Lines of Code (SLOC) = 987
Hits@level = [0]  78 [1]   8 [2]  35 [3]   3 [4]  22 [5]   0
Hits@level+ = [0+] 146 [1+]  68 [2+]  60 [3+]  25 [4+]  22 [5+]   0
Hits/KSLOC@level+ = [0+] 147.923 [1+] 68.8956 [2+] 60.7903 [3+] 25.3293 [4+] 22.2898 [5+]   0
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.