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/gengetopt-2.23+dfsg1/build-aux/arg-nonnull.h Examining data/gengetopt-2.23+dfsg1/build-aux/c++defs.h Examining data/gengetopt-2.23+dfsg1/build-aux/warn-on-use.h Examining data/gengetopt-2.23+dfsg1/gl/gettext.h Examining data/gengetopt-2.23+dfsg1/gl/dummy.c Examining data/gengetopt-2.23+dfsg1/gl/getopt.c Examining data/gengetopt-2.23+dfsg1/gl/getopt1.c Examining data/gengetopt-2.23+dfsg1/gl/strdup.c Examining data/gengetopt-2.23+dfsg1/gl/getopt.in.h Examining data/gengetopt-2.23+dfsg1/gl/getopt_int.h Examining data/gengetopt-2.23+dfsg1/gl/stddef.in.h Examining data/gengetopt-2.23+dfsg1/gl/string.in.h Examining data/gengetopt-2.23+dfsg1/gl/unistd.in.h Examining data/gengetopt-2.23+dfsg1/src/acceptedvalues.h Examining data/gengetopt-2.23+dfsg1/src/errorcodes.h Examining data/gengetopt-2.23+dfsg1/src/fileutils.h Examining data/gengetopt-2.23+dfsg1/src/gm_utils.h Examining data/gengetopt-2.23+dfsg1/src/yyerror.h Examining data/gengetopt-2.23+dfsg1/src/acceptedvalues.cpp Examining data/gengetopt-2.23+dfsg1/src/argsdef.c Examining data/gengetopt-2.23+dfsg1/src/cmdline.c Examining data/gengetopt-2.23+dfsg1/src/fileutils.cpp Examining data/gengetopt-2.23+dfsg1/src/ggos.cpp Examining data/gengetopt-2.23+dfsg1/src/globals.cpp Examining data/gengetopt-2.23+dfsg1/src/gm.cc Examining data/gengetopt-2.23+dfsg1/src/gm_utils.cpp Examining data/gengetopt-2.23+dfsg1/src/parser.cc Examining data/gengetopt-2.23+dfsg1/src/scanner.cc Examining data/gengetopt-2.23+dfsg1/src/yyerror.cc Examining data/gengetopt-2.23+dfsg1/src/gengetopt.cc Examining data/gengetopt-2.23+dfsg1/src/gnugetopt.h Examining data/gengetopt-2.23+dfsg1/src/getopt.c Examining data/gengetopt-2.23+dfsg1/src/getopt1.c Examining data/gengetopt-2.23+dfsg1/src/argsdef.h Examining data/gengetopt-2.23+dfsg1/src/cmdline.h Examining data/gengetopt-2.23+dfsg1/src/gengetopt.h Examining data/gengetopt-2.23+dfsg1/src/ggo_options.h Examining data/gengetopt-2.23+dfsg1/src/ggos.h Examining data/gengetopt-2.23+dfsg1/src/global_opts.h Examining data/gengetopt-2.23+dfsg1/src/globals.h Examining data/gengetopt-2.23+dfsg1/src/gm.h Examining data/gengetopt-2.23+dfsg1/src/groups.h Examining data/gengetopt-2.23+dfsg1/src/parser.h Examining data/gengetopt-2.23+dfsg1/src/skels/c_source.h Examining data/gengetopt-2.23+dfsg1/src/skels/check_modes.h Examining data/gengetopt-2.23+dfsg1/src/skels/clear_arg.h Examining data/gengetopt-2.23+dfsg1/src/skels/clear_given.h Examining data/gengetopt-2.23+dfsg1/src/skels/copyright.h Examining data/gengetopt-2.23+dfsg1/src/skels/custom_getopt_gen.h Examining data/gengetopt-2.23+dfsg1/src/skels/dependant_option.h Examining data/gengetopt-2.23+dfsg1/src/skels/enum_decl.h Examining data/gengetopt-2.23+dfsg1/src/skels/exit_failure.h Examining data/gengetopt-2.23+dfsg1/src/skels/file_save.h Examining data/gengetopt-2.23+dfsg1/src/skels/file_save_multiple.h Examining data/gengetopt-2.23+dfsg1/src/skels/free_list.h Examining data/gengetopt-2.23+dfsg1/src/skels/free_multiple.h Examining data/gengetopt-2.23+dfsg1/src/skels/free_string.h Examining data/gengetopt-2.23+dfsg1/src/skels/generic_option.h Examining data/gengetopt-2.23+dfsg1/src/skels/given_field.h Examining data/gengetopt-2.23+dfsg1/src/skels/group_counter.h Examining data/gengetopt-2.23+dfsg1/src/skels/group_option.h Examining data/gengetopt-2.23+dfsg1/src/skels/handle_help.h Examining data/gengetopt-2.23+dfsg1/src/skels/handle_version.h Examining data/gengetopt-2.23+dfsg1/src/skels/header.h Examining data/gengetopt-2.23+dfsg1/src/skels/init_args_info.h Examining data/gengetopt-2.23+dfsg1/src/skels/multiple_fill_array.h Examining data/gengetopt-2.23+dfsg1/src/skels/multiple_opt_list.h Examining data/gengetopt-2.23+dfsg1/src/skels/option_arg.h Examining data/gengetopt-2.23+dfsg1/src/skels/print_help_string.h Examining data/gengetopt-2.23+dfsg1/src/skels/required_option.h Examining data/gengetopt-2.23+dfsg1/src/skels/reset_group.h Examining data/gengetopt-2.23+dfsg1/src/skels/update_given.h Examining data/gengetopt-2.23+dfsg1/src/skels/c_source.cc Examining data/gengetopt-2.23+dfsg1/src/skels/check_modes.cc Examining data/gengetopt-2.23+dfsg1/src/skels/clear_arg.cc Examining data/gengetopt-2.23+dfsg1/src/skels/clear_given.cc Examining data/gengetopt-2.23+dfsg1/src/skels/copyright.cc Examining data/gengetopt-2.23+dfsg1/src/skels/custom_getopt_gen.cc Examining data/gengetopt-2.23+dfsg1/src/skels/dependant_option.cc Examining data/gengetopt-2.23+dfsg1/src/skels/enum_decl.cc Examining data/gengetopt-2.23+dfsg1/src/skels/exit_failure.cc Examining data/gengetopt-2.23+dfsg1/src/skels/file_save.cc Examining data/gengetopt-2.23+dfsg1/src/skels/file_save_multiple.cc Examining data/gengetopt-2.23+dfsg1/src/skels/free_list.cc Examining data/gengetopt-2.23+dfsg1/src/skels/free_multiple.cc Examining data/gengetopt-2.23+dfsg1/src/skels/free_string.cc Examining data/gengetopt-2.23+dfsg1/src/skels/generic_option.cc Examining data/gengetopt-2.23+dfsg1/src/skels/given_field.cc Examining data/gengetopt-2.23+dfsg1/src/skels/group_counter.cc Examining data/gengetopt-2.23+dfsg1/src/skels/group_option.cc Examining data/gengetopt-2.23+dfsg1/src/skels/handle_help.cc Examining data/gengetopt-2.23+dfsg1/src/skels/handle_version.cc Examining data/gengetopt-2.23+dfsg1/src/skels/header.cc Examining data/gengetopt-2.23+dfsg1/src/skels/init_args_info.cc Examining data/gengetopt-2.23+dfsg1/src/skels/multiple_fill_array.cc Examining data/gengetopt-2.23+dfsg1/src/skels/multiple_opt_list.cc Examining data/gengetopt-2.23+dfsg1/src/skels/option_arg.cc Examining data/gengetopt-2.23+dfsg1/src/skels/print_help_string.cc Examining data/gengetopt-2.23+dfsg1/src/skels/required_option.cc Examining data/gengetopt-2.23+dfsg1/src/skels/reset_group.cc Examining data/gengetopt-2.23+dfsg1/src/skels/update_given.cc Examining data/gengetopt-2.23+dfsg1/src/tests/asserttestexit.h Examining data/gengetopt-2.23+dfsg1/src/tests/test_specialchars.cc Examining data/gengetopt-2.23+dfsg1/doc/cmdline1.c Examining data/gengetopt-2.23+dfsg1/doc/main1.cc Examining data/gengetopt-2.23+dfsg1/doc/cmdline2.c Examining data/gengetopt-2.23+dfsg1/doc/main2.c Examining data/gengetopt-2.23+dfsg1/doc/cmdline1.h Examining data/gengetopt-2.23+dfsg1/doc/cmdline2.h Examining data/gengetopt-2.23+dfsg1/doc/multiple_example.c Examining data/gengetopt-2.23+dfsg1/tests/canonize-names.c Examining data/gengetopt-2.23+dfsg1/tests/default_cmdline.c Examining data/gengetopt-2.23+dfsg1/tests/default_values.c Examining data/gengetopt-2.23+dfsg1/tests/more_than_once.c Examining data/gengetopt-2.23+dfsg1/tests/no_multi_strings.c Examining data/gengetopt-2.23+dfsg1/tests/no_multi_types.c Examining data/gengetopt-2.23+dfsg1/tests/no_optgiven.c Examining data/gengetopt-2.23+dfsg1/tests/no_optgiven2.c Examining data/gengetopt-2.23+dfsg1/tests/no_prog_name.c Examining data/gengetopt-2.23+dfsg1/tests/no_strings.c Examining data/gengetopt-2.23+dfsg1/tests/no_unnamed.c Examining data/gengetopt-2.23+dfsg1/tests/test_all_opts.c Examining data/gengetopt-2.23+dfsg1/tests/test_all_opts_option_help.c Examining data/gengetopt-2.23+dfsg1/tests/test_conf_parser.c Examining data/gengetopt-2.23+dfsg1/tests/test_conf_parser_file_save.c Examining data/gengetopt-2.23+dfsg1/tests/test_conf_parser_ov.c Examining data/gengetopt-2.23+dfsg1/tests/test_conf_parser_ov2.c Examining data/gengetopt-2.23+dfsg1/tests/test_conf_parser_ov3.c Examining data/gengetopt-2.23+dfsg1/tests/test_conf_parser_ov4.c Examining data/gengetopt-2.23+dfsg1/tests/test_groups.c Examining data/gengetopt-2.23+dfsg1/tests/test_groups_option_help.c Examining data/gengetopt-2.23+dfsg1/tests/test_manual_help.c Examining data/gengetopt-2.23+dfsg1/tests/test_manual_help_args.c Examining data/gengetopt-2.23+dfsg1/tests/test_modes.c Examining data/gengetopt-2.23+dfsg1/tests/test_modes_option_help.c Examining data/gengetopt-2.23+dfsg1/tests/test_multiple.cc Examining data/gengetopt-2.23+dfsg1/tests/test_multiple_parsers.c Examining data/gengetopt-2.23+dfsg1/tests/test_newlines.c Examining data/gengetopt-2.23+dfsg1/tests/test_no_handle_help.c Examining data/gengetopt-2.23+dfsg1/tests/test_no_options.c Examining data/gengetopt-2.23+dfsg1/tests/test_only_flags.c Examining data/gengetopt-2.23+dfsg1/tests/test_redef_help.c Examining data/gengetopt-2.23+dfsg1/tests/test_sections.c Examining data/gengetopt-2.23+dfsg1/tests/test_sections_option_help.c Examining data/gengetopt-2.23+dfsg1/tests/test_simple_multiple.cc Examining data/gengetopt-2.23+dfsg1/tests/test_text.c Examining data/gengetopt-2.23+dfsg1/tests/test_unamed.c Examining data/gengetopt-2.23+dfsg1/tests/test_unnamed.c Examining data/gengetopt-2.23+dfsg1/tests/test_usage.c Examining data/gengetopt-2.23+dfsg1/tests/test_values.c Examining data/gengetopt-2.23+dfsg1/tests/test_values_cc.cc Examining data/gengetopt-2.23+dfsg1/tests/test_values_cmd_cc.cc Examining data/gengetopt-2.23+dfsg1/tests/test_manual_help_cmd.c Examining data/gengetopt-2.23+dfsg1/tests/test_manual_help_cmd.h FINAL RESULTS: data/gengetopt-2.23+dfsg1/gl/unistd.in.h:222:11: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. # undef chown data/gengetopt-2.23+dfsg1/gl/unistd.in.h:223:12: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. # define chown rpl_chown data/gengetopt-2.23+dfsg1/gl/unistd.in.h:225:19: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. _GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid) data/gengetopt-2.23+dfsg1/gl/unistd.in.h:227:19: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. _GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)); data/gengetopt-2.23+dfsg1/gl/unistd.in.h:230:19: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. _GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid) data/gengetopt-2.23+dfsg1/gl/unistd.in.h:233:19: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. _GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)); data/gengetopt-2.23+dfsg1/gl/unistd.in.h:235:19: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. _GL_CXXALIASWARN (chown); data/gengetopt-2.23+dfsg1/gl/unistd.in.h:237:9: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. # undef chown data/gengetopt-2.23+dfsg1/gl/unistd.in.h:239:18: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and " data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1061:12: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. # define readlink rpl_readlink data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1063:19: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. _GL_FUNCDECL_RPL (readlink, ssize_t, data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1066:19: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. _GL_CXXALIAS_RPL (readlink, ssize_t, data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1070:19: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. _GL_FUNCDECL_SYS (readlink, ssize_t, data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1074:19: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. _GL_CXXALIAS_SYS (readlink, ssize_t, data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1077:19: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. _GL_CXXALIASWARN (readlink); data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1079:9: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. # undef readlink data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1081:18: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. _GL_WARN_ON_USE (readlink, "readlink is unportable - " data/gengetopt-2.23+dfsg1/doc/cmdline1.c:466:3: [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(result, s); data/gengetopt-2.23+dfsg1/doc/cmdline2.c:374:3: [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(result, s); data/gengetopt-2.23+dfsg1/gl/unistd.in.h:209:18: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. _GL_WARN_ON_USE (access, "the access function is a security risk - " data/gengetopt-2.23+dfsg1/gl/unistd.in.h:664:19: [4] (misc) getlogin: It's often easy to fool getlogin. Sometimes it does not work at all, because some program messed up the utmp file. Often, it gives only the first 8 characters of the login name. The user currently logged in on the controlling tty of our program need not be the user who started it. Avoid getlogin() for security-related purposes (CWE-807). Use getpwuid(geteuid()) and extract the desired information instead. _GL_FUNCDECL_SYS (getlogin, char *, (void)); data/gengetopt-2.23+dfsg1/gl/unistd.in.h:666:19: [4] (misc) getlogin: It's often easy to fool getlogin. Sometimes it does not work at all, because some program messed up the utmp file. Often, it gives only the first 8 characters of the login name. The user currently logged in on the controlling tty of our program need not be the user who started it. Avoid getlogin() for security-related purposes (CWE-807). Use getpwuid(geteuid()) and extract the desired information instead. _GL_CXXALIAS_SYS (getlogin, char *, (void)); data/gengetopt-2.23+dfsg1/gl/unistd.in.h:667:19: [4] (misc) getlogin: It's often easy to fool getlogin. Sometimes it does not work at all, because some program messed up the utmp file. Often, it gives only the first 8 characters of the login name. The user currently logged in on the controlling tty of our program need not be the user who started it. Avoid getlogin() for security-related purposes (CWE-807). Use getpwuid(geteuid()) and extract the desired information instead. _GL_CXXALIASWARN (getlogin); data/gengetopt-2.23+dfsg1/gl/unistd.in.h:669:9: [4] (misc) getlogin: It's often easy to fool getlogin. Sometimes it does not work at all, because some program messed up the utmp file. Often, it gives only the first 8 characters of the login name. The user currently logged in on the controlling tty of our program need not be the user who started it. Avoid getlogin() for security-related purposes (CWE-807). Use getpwuid(geteuid()) and extract the desired information instead. # undef getlogin data/gengetopt-2.23+dfsg1/gl/unistd.in.h:671:18: [4] (misc) getlogin: It's often easy to fool getlogin. Sometimes it does not work at all, because some program messed up the utmp file. Often, it gives only the first 8 characters of the login name. The user currently logged in on the controlling tty of our program need not be the user who started it. Avoid getlogin() for security-related purposes (CWE-807). Use getpwuid(geteuid()) and extract the desired information instead. _GL_WARN_ON_USE (getlogin, "getlogin is unportable - " data/gengetopt-2.23+dfsg1/src/cmdline.c:611:3: [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(result, s); data/gengetopt-2.23+dfsg1/src/fileutils.cpp:39:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (filename, "%s.%s", name, ext); data/gengetopt-2.23+dfsg1/src/parser.cc:898:21: [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. # define YYFPRINTF fprintf data/gengetopt-2.23+dfsg1/tests/test_conf_parser_file_save.c:35:3: [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(conf_file, args_info.conf_file_arg); data/gengetopt-2.23+dfsg1/tests/test_manual_help_cmd.c:300:3: [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(result, s); data/gengetopt-2.23+dfsg1/doc/cmdline1.c:748:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt_long (argc, argv, "hVs:m:i:FS:D:", long_options, &option_index); data/gengetopt-2.23+dfsg1/doc/cmdline2.c:670:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt_long (argc, argv, "hVs:i:S:l:f:d:L:y:FNx", long_options, &option_index); data/gengetopt-2.23+dfsg1/gl/getopt.c:101:14: [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. extern char *getenv (); data/gengetopt-2.23+dfsg1/gl/getopt.c:237:47: [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. d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT"); data/gengetopt-2.23+dfsg1/gl/getopt.c:1104:1: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (int argc, char *const *argv, const char *optstring) data/gengetopt-2.23+dfsg1/gl/getopt.c:1139:11: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt (argc, argv, "abc:d:0123456789"); data/gengetopt-2.23+dfsg1/gl/getopt.in.h:56:9: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # undef getopt data/gengetopt-2.23+dfsg1/gl/getopt.in.h:57:9: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # undef getopt_long data/gengetopt-2.23+dfsg1/gl/getopt.in.h:67:10: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # define getopt __GETOPT_ID (getopt) data/gengetopt-2.23+dfsg1/gl/getopt.in.h:67:30: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # define getopt __GETOPT_ID (getopt) data/gengetopt-2.23+dfsg1/gl/getopt.in.h:68:10: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # define getopt_long __GETOPT_ID (getopt_long) data/gengetopt-2.23+dfsg1/gl/getopt.in.h:68:35: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. # define getopt_long __GETOPT_ID (getopt_long) data/gengetopt-2.23+dfsg1/gl/getopt.in.h:226:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) data/gengetopt-2.23+dfsg1/gl/getopt.in.h:230:12: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, data/gengetopt-2.23+dfsg1/gl/getopt1.c:40:1: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt_long (int argc, char *__getopt_argv_const *argv, const char *options, data/gengetopt-2.23+dfsg1/gl/getopt1.c:105:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt_long (argc, argv, "abc:d:0123456789", data/gengetopt-2.23+dfsg1/src/cmdline.c:840:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt_long (argc, argv, "hVi:f:a:F:c:H:lu::CSGnNeg", long_options, &option_index); data/gengetopt-2.23+dfsg1/src/getopt.c:211:9: [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. #ifndef getenv data/gengetopt-2.23+dfsg1/src/getopt.c:212:14: [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. extern char *getenv (); data/gengetopt-2.23+dfsg1/src/getopt.c:397:21: [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. posixly_correct = getenv ("POSIXLY_CORRECT"); data/gengetopt-2.23+dfsg1/src/getopt.c:972:1: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt (argc, argv, optstring) data/gengetopt-2.23+dfsg1/src/getopt.c:1002:11: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt (argc, argv, "abc:d:0123456789"); data/gengetopt-2.23+dfsg1/src/getopt1.c:67:1: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. getopt_long (argc, argv, options, long_options, opt_index) data/gengetopt-2.23+dfsg1/src/getopt1.c:123:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt_long (argc, argv, "abc:d:0123456789", data/gengetopt-2.23+dfsg1/src/gnugetopt.h:145:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (int __argc, char *const *__argv, const char *__shortopts); data/gengetopt-2.23+dfsg1/src/gnugetopt.h:147:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (); data/gengetopt-2.23+dfsg1/src/gnugetopt.h:151:12: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, data/gengetopt-2.23+dfsg1/src/gnugetopt.h:164:12: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt (); data/gengetopt-2.23+dfsg1/src/gnugetopt.h:166:12: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. extern int getopt_long (); data/gengetopt-2.23+dfsg1/tests/test_manual_help_cmd.c:521:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt_long (argc, argv, "h?V", long_options, &option_index); data/gengetopt-2.23+dfsg1/doc/cmdline1.c:87:7: [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. const char *gengetopt_args_info_full_help[21]; data/gengetopt-2.23+dfsg1/doc/cmdline1.c:115:7: [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. const char *gengetopt_args_info_help[20]; data/gengetopt-2.23+dfsg1/doc/cmdline1.c:435: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). outfile = fopen(filename, "w"); data/gengetopt-2.23+dfsg1/doc/cmdline2.c:74:7: [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. const char *gengetopt_args_info_help[14]; data/gengetopt-2.23+dfsg1/doc/cmdline2.c:343: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). outfile = fopen(filename, "w"); data/gengetopt-2.23+dfsg1/gl/gettext.h:210:3: [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 msg_ctxt_id[msgctxt_len + msgid_len]; data/gengetopt-2.23+dfsg1/gl/gettext.h:212:3: [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 buf[1024]; data/gengetopt-2.23+dfsg1/gl/gettext.h:220:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); data/gengetopt-2.23+dfsg1/gl/gettext.h:222:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); data/gengetopt-2.23+dfsg1/gl/gettext.h:256:3: [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 msg_ctxt_id[msgctxt_len + msgid_len]; data/gengetopt-2.23+dfsg1/gl/gettext.h:258:3: [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 buf[1024]; data/gengetopt-2.23+dfsg1/gl/gettext.h:266:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); data/gengetopt-2.23+dfsg1/gl/gettext.h:268:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); data/gengetopt-2.23+dfsg1/gl/strdup.c:48:19: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. return (char *) memcpy (new, s, len); data/gengetopt-2.23+dfsg1/src/cmdline.c:130:7: [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. const char *gengetopt_args_info_full_help[40]; data/gengetopt-2.23+dfsg1/src/cmdline.c:177:7: [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. const char *gengetopt_args_info_help[39]; data/gengetopt-2.23+dfsg1/src/cmdline.c:580: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). outfile = fopen(filename, "w"); data/gengetopt-2.23+dfsg1/src/parser.cc:1189:3: [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 const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; data/gengetopt-2.23+dfsg1/src/parser.cc:1395:3: [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 yymsgbuf[128]; data/gengetopt-2.23+dfsg1/src/scanner.cc:668:1: [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[LINEBUF_LEN] ; /* current line */ data/gengetopt-2.23+dfsg1/tests/no_prog_name.c:27:3: [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 *my_argv[6]; data/gengetopt-2.23+dfsg1/tests/test_conf_parser_file_save.c:20:1: [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 conf_file[256]; data/gengetopt-2.23+dfsg1/tests/test_manual_help_cmd.c:58:7: [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. const char *gengetopt_args_info_help[6]; data/gengetopt-2.23+dfsg1/tests/test_manual_help_cmd.c:269: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). outfile = fopen(filename, "w"); data/gengetopt-2.23+dfsg1/doc/cmdline1.c:205:7: [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). (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), data/gengetopt-2.23+dfsg1/doc/cmdline1.c:208:7: [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 (strlen(gengetopt_args_info_versiontext) > 0) data/gengetopt-2.23+dfsg1/doc/cmdline1.c:214: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). size_t len_purpose = strlen(gengetopt_args_info_purpose); data/gengetopt-2.23+dfsg1/doc/cmdline1.c:215:21: [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). size_t len_usage = strlen(gengetopt_args_info_usage); data/gengetopt-2.23+dfsg1/doc/cmdline1.c:228:6: [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 (strlen(gengetopt_args_info_description) > 0) { data/gengetopt-2.23+dfsg1/doc/cmdline1.c:348:21: [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). for (i = 0, len = strlen(val); values[i]; ++i) data/gengetopt-2.23+dfsg1/doc/cmdline1.c:354: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). if (strlen(values[i]) == len) data/gengetopt-2.23+dfsg1/doc/cmdline1.c:463:26: [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). result = (char*)malloc(strlen(s) + 1); data/gengetopt-2.23+dfsg1/doc/cmdline2.c:165:7: [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). (strlen(MY_CMDLINE_PARSER_PACKAGE_NAME) ? MY_CMDLINE_PARSER_PACKAGE_NAME : MY_CMDLINE_PARSER_PACKAGE), data/gengetopt-2.23+dfsg1/doc/cmdline2.c:168:7: [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 (strlen(gengetopt_args_info_versiontext) > 0) data/gengetopt-2.23+dfsg1/doc/cmdline2.c:174: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). size_t len_purpose = strlen(gengetopt_args_info_purpose); data/gengetopt-2.23+dfsg1/doc/cmdline2.c:175:21: [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). size_t len_usage = strlen(gengetopt_args_info_usage); data/gengetopt-2.23+dfsg1/doc/cmdline2.c:188:6: [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 (strlen(gengetopt_args_info_description) > 0) { data/gengetopt-2.23+dfsg1/doc/cmdline2.c:371:26: [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). result = (char*)malloc(strlen(s) + 1); data/gengetopt-2.23+dfsg1/gl/getopt.c:268:56: [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 len = d->__nonoption_flags_max_len = strlen (orig_str); data/gengetopt-2.23+dfsg1/gl/getopt.c:498:35: [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). == (unsigned int) strlen (p->name)) data/gengetopt-2.23+dfsg1/gl/getopt.c:547:28: [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). d->__nextchar += strlen (d->__nextchar); data/gengetopt-2.23+dfsg1/gl/getopt.c:620:36: [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). d->__nextchar += strlen (d->__nextchar); data/gengetopt-2.23+dfsg1/gl/getopt.c:660:36: [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). d->__nextchar += strlen (d->__nextchar); data/gengetopt-2.23+dfsg1/gl/getopt.c:665:28: [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). d->__nextchar += strlen (d->__nextchar); data/gengetopt-2.23+dfsg1/gl/getopt.c:855:63: [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 ((unsigned int) (nameend - d->__nextchar) == strlen (p->name)) data/gengetopt-2.23+dfsg1/gl/getopt.c:903:30: [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). d->__nextchar += strlen (d->__nextchar); data/gengetopt-2.23+dfsg1/gl/getopt.c:947:38: [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). d->__nextchar += strlen (d->__nextchar); data/gengetopt-2.23+dfsg1/gl/getopt.c:985:38: [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). d->__nextchar += strlen (d->__nextchar); data/gengetopt-2.23+dfsg1/gl/getopt.c:991:30: [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). d->__nextchar += strlen (d->__nextchar); data/gengetopt-2.23+dfsg1/gl/gettext.h:206: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). size_t msgctxt_len = strlen (msgctxt) + 1; data/gengetopt-2.23+dfsg1/gl/gettext.h:207: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). size_t msgid_len = strlen (msgid) + 1; data/gengetopt-2.23+dfsg1/gl/gettext.h:252: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). size_t msgctxt_len = strlen (msgctxt) + 1; data/gengetopt-2.23+dfsg1/gl/gettext.h:253: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). size_t msgid_len = strlen (msgid) + 1; data/gengetopt-2.23+dfsg1/gl/strdup.c:42:16: [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). size_t len = strlen (s) + 1; data/gengetopt-2.23+dfsg1/gl/string.in.h:336:11: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. # undef strncat data/gengetopt-2.23+dfsg1/gl/string.in.h:337:12: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. # define strncat rpl_strncat data/gengetopt-2.23+dfsg1/gl/string.in.h:339:19: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. _GL_FUNCDECL_RPL (strncat, char *, (char *dest, const char *src, size_t n) data/gengetopt-2.23+dfsg1/gl/string.in.h:341:19: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. _GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n)); data/gengetopt-2.23+dfsg1/gl/string.in.h:343:19: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. _GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n)); data/gengetopt-2.23+dfsg1/gl/string.in.h:345:19: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. _GL_CXXALIASWARN (strncat); data/gengetopt-2.23+dfsg1/gl/string.in.h:347:9: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. # undef strncat data/gengetopt-2.23+dfsg1/gl/string.in.h:349:18: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. _GL_WARN_ON_USE (strncat, "strncat is unportable - " data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1282:11: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. # undef usleep data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1283:12: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. # define usleep rpl_usleep data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1285:19: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. _GL_FUNCDECL_RPL (usleep, int, (useconds_t n)); data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1286:19: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. _GL_CXXALIAS_RPL (usleep, int, (useconds_t n)); data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1289:19: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. _GL_FUNCDECL_SYS (usleep, int, (useconds_t n)); data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1291:19: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. _GL_CXXALIAS_SYS (usleep, int, (useconds_t n)); data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1293:19: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. _GL_CXXALIASWARN (usleep); data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1295:9: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. # undef usleep data/gengetopt-2.23+dfsg1/gl/unistd.in.h:1297:18: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. _GL_WARN_ON_USE (usleep, "usleep is unportable - " data/gengetopt-2.23+dfsg1/src/cmdline.c:342:7: [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). (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), data/gengetopt-2.23+dfsg1/src/cmdline.c:345:7: [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 (strlen(gengetopt_args_info_versiontext) > 0) data/gengetopt-2.23+dfsg1/src/cmdline.c:351: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). size_t len_purpose = strlen(gengetopt_args_info_purpose); data/gengetopt-2.23+dfsg1/src/cmdline.c:352:21: [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). size_t len_usage = strlen(gengetopt_args_info_usage); data/gengetopt-2.23+dfsg1/src/cmdline.c:365:6: [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 (strlen(gengetopt_args_info_description) > 0) { data/gengetopt-2.23+dfsg1/src/cmdline.c:608:26: [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). result = (char*)malloc(strlen(s) + 1); data/gengetopt-2.23+dfsg1/src/cmdline.c:1344: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). while (p && strlen(p)) data/gengetopt-2.23+dfsg1/src/cmdline.c:1348:20: [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 (j && j < strlen(p)) data/gengetopt-2.23+dfsg1/src/fileutils.cpp:30:31: [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). filename = (char *) malloc (strlen (name) + strlen (ext) + 2); data/gengetopt-2.23+dfsg1/src/fileutils.cpp:30:47: [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). filename = (char *) malloc (strlen (name) + strlen (ext) + 2); data/gengetopt-2.23+dfsg1/src/gengetopt.cc:516:36: [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). expected_eos = (char *) (val + strlen(val)); data/gengetopt-2.23+dfsg1/src/getopt.c:234:51: [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 (!defined __STDC__ || !__STDC__) && !defined strlen data/gengetopt-2.23+dfsg1/src/getopt.c:237:12: [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). extern int strlen (const char *); data/gengetopt-2.23+dfsg1/src/getopt.c:428:44: [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 len = nonoption_flags_max_len = strlen (orig_str); data/gengetopt-2.23+dfsg1/src/getopt.c:656:21: [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). == (unsigned int) strlen (p->name)) data/gengetopt-2.23+dfsg1/src/getopt.c:683:16: [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). nextchar += strlen (nextchar); data/gengetopt-2.23+dfsg1/src/getopt.c:715: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). nextchar += strlen (nextchar); data/gengetopt-2.23+dfsg1/src/getopt.c:731: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). nextchar += strlen (nextchar); data/gengetopt-2.23+dfsg1/src/getopt.c:736:16: [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). nextchar += strlen (nextchar); data/gengetopt-2.23+dfsg1/src/getopt.c:847:51: [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 ((unsigned int) (nameend - nextchar) == strlen (p->name)) data/gengetopt-2.23+dfsg1/src/getopt.c:870:18: [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). nextchar += strlen (nextchar); data/gengetopt-2.23+dfsg1/src/getopt.c:890:19: [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). nextchar += strlen (nextchar); data/gengetopt-2.23+dfsg1/src/getopt.c:904:19: [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). nextchar += strlen (nextchar); data/gengetopt-2.23+dfsg1/src/getopt.c:908:18: [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). nextchar += strlen (nextchar); data/gengetopt-2.23+dfsg1/src/gm.cc:694: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). wrap_cstr ( wrapped, strlen("Usage: "), 2, usage.str() ); data/gengetopt-2.23+dfsg1/src/gm.cc:721:34: [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). wrap_cstr ( mode_line, strlen(" or : "), 2, usage.str() ); data/gengetopt-2.23+dfsg1/src/gm.cc:1082: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). width += strlen (opt->long_opt) + 2; // "--" data/gengetopt-2.23+dfsg1/src/gm.cc:1091:20: [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). type_len = strlen(type_str); data/gengetopt-2.23+dfsg1/src/gm.cc:1149:34: [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 (opt->group_desc && strlen (opt->group_desc)) data/gengetopt-2.23+dfsg1/src/gm.cc:1168:33: [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 (opt->mode_desc && strlen (opt->mode_desc)) data/gengetopt-2.23+dfsg1/src/gm.cc:1220:26: [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). type_len = strlen(type_str); data/gengetopt-2.23+dfsg1/src/parser.cc:1086:21: [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). # define yystrlen strlen data/gengetopt-2.23+dfsg1/src/scanner.cc:802:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ data/gengetopt-2.23+dfsg1/src/scanner.cc:2028:37: [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). return yy_scan_bytes( yystr, (int) strlen(yystr) ); data/gengetopt-2.23+dfsg1/src/scanner.cc:2348:11: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (linebuf, ( (p+1) ? p+1 : ""), LINEBUF_LEN - 1); data/gengetopt-2.23+dfsg1/src/scanner.cc:2355:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (linebuf, yytext+1, LINEBUF_LEN - 1); /* save the next line */ data/gengetopt-2.23+dfsg1/src/yyerror.cc:38: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). if (/*!linebuf || */!strlen(linebuf)) data/gengetopt-2.23+dfsg1/tests/test_manual_help_cmd.c:115:7: [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). (strlen(TEST_MANUAL_HELP_CMD_PARSER_PACKAGE_NAME) ? TEST_MANUAL_HELP_CMD_PARSER_PACKAGE_NAME : TEST_MANUAL_HELP_CMD_PARSER_PACKAGE), data/gengetopt-2.23+dfsg1/tests/test_manual_help_cmd.c:118:7: [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 (strlen(gengetopt_args_info_versiontext) > 0) data/gengetopt-2.23+dfsg1/tests/test_manual_help_cmd.c:124: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). size_t len_purpose = strlen(gengetopt_args_info_purpose); data/gengetopt-2.23+dfsg1/tests/test_manual_help_cmd.c:125:21: [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). size_t len_usage = strlen(gengetopt_args_info_usage); data/gengetopt-2.23+dfsg1/tests/test_manual_help_cmd.c:138:6: [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 (strlen(gengetopt_args_info_description) > 0) { data/gengetopt-2.23+dfsg1/tests/test_manual_help_cmd.c:297:26: [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). result = (char*)malloc(strlen(s) + 1); ANALYSIS SUMMARY: Hits = 174 Lines analyzed = 35130 in approximately 0.93 seconds (37621 lines/second) Physical Source Lines of Code (SLOC) = 27067 Hits@level = [0] 364 [1] 90 [2] 24 [3] 30 [4] 13 [5] 17 Hits@level+ = [0+] 538 [1+] 174 [2+] 84 [3+] 60 [4+] 30 [5+] 17 Hits/KSLOC@level+ = [0+] 19.8766 [1+] 6.42849 [2+] 3.10341 [3+] 2.21672 [4+] 1.10836 [5+] 0.628071 Dot directories skipped = 1 (--followdotdir overrides) 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.