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/pal-0.4.3/src/main.h Examining data/pal-0.4.3/src/latex.c Examining data/pal-0.4.3/src/latex.h Examining data/pal-0.4.3/src/output.h Examining data/pal-0.4.3/src/del.c Examining data/pal-0.4.3/src/rl.c Examining data/pal-0.4.3/src/html.h Examining data/pal-0.4.3/src/input.h Examining data/pal-0.4.3/src/remind.c Examining data/pal-0.4.3/src/colorize.c Examining data/pal-0.4.3/src/html.c Examining data/pal-0.4.3/src/remind.h Examining data/pal-0.4.3/src/del.h Examining data/pal-0.4.3/src/add.c Examining data/pal-0.4.3/src/edit.h Examining data/pal-0.4.3/src/output.c Examining data/pal-0.4.3/src/event.h Examining data/pal-0.4.3/src/manage.c Examining data/pal-0.4.3/src/event.c Examining data/pal-0.4.3/src/manage.h Examining data/pal-0.4.3/src/add.h Examining data/pal-0.4.3/src/colorize.h Examining data/pal-0.4.3/src/rl.h Examining data/pal-0.4.3/src/main.c Examining data/pal-0.4.3/src/edit.c Examining data/pal-0.4.3/src/input.c Examining data/pal-0.4.3/src/search.c Examining data/pal-0.4.3/src/search.h Examining data/pal-0.4.3/src/convert/pal2ical.c Examining data/pal-0.4.3/src/convert/ical2pal.c FINAL RESULTS: data/pal-0.4.3/src/add.c:90:10: [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( buf, s ); data/pal-0.4.3/src/edit.c:210:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(align_prompt, 128, align, prompt); data/pal-0.4.3/src/event.c:267:5: [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( buffer, day_names[ g_date_get_weekday(date) ] ); data/pal-0.4.3/src/input.c:255:5: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(s, "%s", date_string); data/pal-0.4.3/src/input.c:265:5: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(tmp, "%s", date_string); data/pal-0.4.3/src/input.c:466:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(pal_file, file); data/pal-0.4.3/src/input.c:473:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(pal_file, "%s/%s", dirname, file); data/pal-0.4.3/src/input.c:477:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(pal_file, PREFIX "/share/pal/%s", file); data/pal-0.4.3/src/input.c:483:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(other_file, "%s/%s", dirname, file); data/pal-0.4.3/src/input.c:621:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(pal_file, settings->pal_file); data/pal-0.4.3/src/input.c:642:5: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if(sscanf(s, "file %s (%[a-z])\n", text, color) == 2 || data/pal-0.4.3/src/input.c:643:6: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(s, "file %s\n", text) == 1) data/pal-0.4.3/src/input.c:652:9: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if(sscanf(s, "file_hide %s (%[a-z])\n", text, color) == 2) data/pal-0.4.3/src/input.c:654:14: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. else if(sscanf(s, "file_hide %s\n", text) == 1) data/pal-0.4.3/src/input.c:686:10: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. else if(sscanf(s, "date_fmt %s",text) == 1) data/pal-0.4.3/src/input.c:705:10: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. else if(sscanf(s, "compact_date_fmt %s",text) == 1) data/pal-0.4.3/src/input.c:710:10: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. else if(sscanf(s, "event_color %s",text) == 1) data/pal-0.4.3/src/main.c:580:28: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if(on_arg > total_args || sscanf(*args, "%s", tmp) != 1) data/pal-0.4.3/src/main.c:597:28: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if(on_arg > total_args || sscanf(*args, "%s", tmp) != 1) data/pal-0.4.3/src/main.c:612:28: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if(on_arg > total_args || sscanf(*args, "%s", username) != 1) data/pal-0.4.3/src/output.c:70:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buf, 2048, formatString, argptr); data/pal-0.4.3/src/output.c:87:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buf, 2048, formatString, argptr); data/pal-0.4.3/src/output.c:104:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buf, 2048, formatString, argptr); data/pal-0.4.3/src/remind.c:154:18: [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. return_val = system(g_strconcat("at -f ", tmp_name, " ", at_string, NULL)); data/pal-0.4.3/src/add.c:310:29: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. filename = g_strconcat(g_get_home_dir(), filename+1, NULL); data/pal-0.4.3/src/colorize.c:38:18: [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. char *term = getenv("TERM"); data/pal-0.4.3/src/colorize.c:46: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. if( getenv("COLORTERM") != NULL || data/pal-0.4.3/src/input.c:553:32: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. out_dirname = g_strconcat(g_get_home_dir(), "/.pal", NULL); data/pal-0.4.3/src/main.c:738:39: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. settings->conf_file = g_strconcat(g_get_home_dir(), "/.pal/pal.conf", NULL); data/pal-0.4.3/src/add.c:184:9: [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[16] = ""; data/pal-0.4.3/src/add.c:191:9: [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, " %2d ", i ); data/pal-0.4.3/src/add.c:343:17: [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). FILE* file = fopen(filename, "w"); data/pal-0.4.3/src/add.c:409:9: [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). file = fopen(filename, "r"); data/pal-0.4.3/src/add.c:426:9: [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). file = fopen(filename, "a"); data/pal-0.4.3/src/add.c:462:5: [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[128] =""; data/pal-0.4.3/src/convert/ical2pal.c:55:2: [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 startstop[19]; data/pal-0.4.3/src/convert/ical2pal.c:56:2: [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 time[15]; data/pal-0.4.3/src/convert/ical2pal.c:329:14: [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). stream = fopen(argv[1],"r"); data/pal-0.4.3/src/convert/pal2ical.c:34:8: [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. extern char *tzname[2]; data/pal-0.4.3/src/convert/pal2ical.c:105:14: [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). stream = fopen(argv[1],"r"); data/pal-0.4.3/src/del.c:43:12: [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). file = fopen(filename, "r"); data/pal-0.4.3/src/del.c:51:16: [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). out_file = fopen(out_filename, "w"); data/pal-0.4.3/src/edit.c:137:5: [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(fieldlist, initfieldlist, sizeof(PalViewEvent)*NUM_FIELDS); data/pal-0.4.3/src/event.c:70:2: [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(new->start_date, orig->start_date, sizeof(GDate)); data/pal-0.4.3/src/event.c:78:2: [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(new->end_date, orig->end_date, sizeof(GDate)); data/pal-0.4.3/src/event.c:86:2: [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(new->start_time, orig->start_time, sizeof(PalTime)); data/pal-0.4.3/src/event.c:94:2: [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(new->end_time, orig->end_time, sizeof(PalTime)); data/pal-0.4.3/src/event.c:163:5: [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, "TODO" ); data/pal-0.4.3/src/event.c:183:5: [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, "DAILY" ); data/pal-0.4.3/src/event.c:238:5: [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[128]; data/pal-0.4.3/src/event.c:240:11: [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. ptr = strcpy( buf, "Only on " ); data/pal-0.4.3/src/event.c:273:5: [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[128]; data/pal-0.4.3/src/event.c:303:5: [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[128]; data/pal-0.4.3/src/event.c:348:5: [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 buf1[128]; data/pal-0.4.3/src/event.c:349:5: [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 buf2[128]; data/pal-0.4.3/src/event.c:390:5: [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 suffix[16]; data/pal-0.4.3/src/event.c:391:5: [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 buf1[128]; data/pal-0.4.3/src/event.c:392:5: [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 buf2[128]; data/pal-0.4.3/src/event.c:435:5: [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 suffix[16]; data/pal-0.4.3/src/event.c:436:5: [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 buf1[128]; data/pal-0.4.3/src/event.c:437:5: [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 buf2[128]; data/pal-0.4.3/src/event.c:438:5: [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 buf3[128]; data/pal-0.4.3/src/event.c:484:5: [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 buf1[128]; data/pal-0.4.3/src/event.c:485:5: [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 buf2[128]; data/pal-0.4.3/src/event.c:535:5: [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 buf1[128]; data/pal-0.4.3/src/event.c:536:5: [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 buf2[128]; data/pal-0.4.3/src/event.c:537:5: [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 buf3[128]; data/pal-0.4.3/src/event.c:684:5: [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[128]; data/pal-0.4.3/src/event.c:951:13: [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. out += sprintf(out, "%i", diff); data/pal-0.4.3/src/input.c:388: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). out_file = fopen(out_filename, "w"); data/pal-0.4.3/src/input.c:509:18: [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). FILE* file = fopen(filename, "r"); data/pal-0.4.3/src/input.c:571: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). file = fopen("/etc/pal.conf", "r"); data/pal-0.4.3/src/input.c:576: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). file = fopen(PREFIX "/share/pal/pal.conf", "r"); data/pal-0.4.3/src/input.c:587:17: [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). out_file = fopen(out_path, "w"); data/pal-0.4.3/src/input.c:609: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). file = fopen(settings->conf_file, "r"); data/pal-0.4.3/src/latex.c:190:2: [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( date, settings->query_date, sizeof(GDate) ); data/pal-0.4.3/src/manage.c:74:5: [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( date, selected_day, sizeof(GDate) ); data/pal-0.4.3/src/manage.c:163:13: [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( date_text, "None" ); data/pal-0.4.3/src/manage.c:171:13: [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( date_text, "None" ); data/pal-0.4.3/src/manage.c:264:5: [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( searchdate, selected_day, sizeof(GDate) ); data/pal-0.4.3/src/manage.c:305:5: [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( searchdate, selected_day, sizeof(GDate) ); data/pal-0.4.3/src/manage.c:327:13: [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( selected_day, searchdate, sizeof(GDate) ); data/pal-0.4.3/src/output.c:324:5: [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(date, today, sizeof(GDate)); data/pal-0.4.3/src/remind.c:112:5: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). mkstemp(tmp_name); data/pal-0.4.3/src/remind.c:113:18: [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). tmp_stream = fopen(tmp_name, "w"); data/pal-0.4.3/src/search.c:48:5: [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( searchdate, date, sizeof( GDate ) ); data/pal-0.4.3/src/search.c:69: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(tmp, searchdate, sizeof(GDate)); data/pal-0.4.3/src/add.c:419:8: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(fgetc(file)!= '\n') data/pal-0.4.3/src/convert/ical2pal.c:320:8: [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(argv[2]) == 0) data/pal-0.4.3/src/convert/ical2pal.c:322:13: [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). else if(strlen(argv[2]) == 1) data/pal-0.4.3/src/event.c:222:5: [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(date_string) == 8) data/pal-0.4.3/src/event.c:289:5: [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(date_string) == 8) data/pal-0.4.3/src/event.c:332:5: [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(date_string) == 8) data/pal-0.4.3/src/event.c:370:9: [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(date_string) == 5) data/pal-0.4.3/src/event.c:415:9: [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(date_string) == 5) data/pal-0.4.3/src/event.c:457:9: [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(date_string) == 5) data/pal-0.4.3/src/event.c:509:9: [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(date_string) == 5) data/pal-0.4.3/src/event.c:555:5: [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(date_string) == 6) data/pal-0.4.3/src/event.c:929:48: [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). gchar* out_string = g_malloc(sizeof(gchar)*strlen(event->text)*2); data/pal-0.4.3/src/event.c:934: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( *in == '!' && strlen(in) > 5 && data/pal-0.4.3/src/input.c:258: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). text_string = g_strdup(s+strlen(date_string)); data/pal-0.4.3/src/input.c:290:8: [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(text_string) == 0) data/pal-0.4.3/src/input.c:366: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). if(strncmp(filename, PREFIX "/share/pal", strlen(PREFIX "/share/pal")) == 0) data/pal-0.4.3/src/input.c:595:10: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(file); data/pal-0.4.3/src/input.c:599:5: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c=fgetc(file); data/pal-0.4.3/src/main.c:87: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). if(strncmp(date_string, _("tomorrow"), strlen(_("tomorrow"))) == 0) data/pal-0.4.3/src/main.c:93:45: [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(strncmp(date_string, _("yesterday"), strlen(_("yesterday"))) == 0) data/pal-0.4.3/src/main.c:99:41: [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(strncmp(date_string, _("today"), strlen(_("today"))) == 0) data/pal-0.4.3/src/main.c:105: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). if(strncmp(date_string, _("mo"), strlen(_("mo"))) == 0 || data/pal-0.4.3/src/main.c:106:43: [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). strncmp(date_string, _("next mo"), strlen(_("next mo"))) == 0) data/pal-0.4.3/src/main.c:112: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). if(strncmp(date_string, _("tu"), strlen(_("tu"))) == 0 || data/pal-0.4.3/src/main.c:113:43: [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). strncmp(date_string, _("next tu"), strlen(_("next tu"))) == 0) data/pal-0.4.3/src/main.c:119: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). if(strncmp(date_string, _("we"), strlen(_("we"))) == 0 || data/pal-0.4.3/src/main.c:120:43: [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). strncmp(date_string, _("next we"), strlen(_("next we"))) == 0) data/pal-0.4.3/src/main.c:126: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). if(strncmp(date_string, _("th"), strlen(_("th"))) == 0 || data/pal-0.4.3/src/main.c:127:43: [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). strncmp(date_string, _("next th"), strlen(_("next th"))) == 0) data/pal-0.4.3/src/main.c:133: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). if(strncmp(date_string, _("fr"), strlen(_("fr"))) == 0 || data/pal-0.4.3/src/main.c:134:43: [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). strncmp(date_string, _("next fr"), strlen(_("next fr"))) == 0) data/pal-0.4.3/src/main.c:140: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). if(strncmp(date_string, _("sa"), strlen(_("sa"))) == 0 || data/pal-0.4.3/src/main.c:141:43: [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). strncmp(date_string, _("next sa"), strlen(_("next sa"))) == 0) data/pal-0.4.3/src/main.c:146: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). if(strncmp(date_string, _("su"), strlen(_("su"))) == 0 || data/pal-0.4.3/src/main.c:147:43: [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). strncmp(date_string, _("next su"), strlen(_("next su"))) == 0) data/pal-0.4.3/src/main.c:153:43: [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(strncmp(date_string, _("last mo"), strlen(_("last mo"))) == 0) data/pal-0.4.3/src/main.c:159:43: [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(strncmp(date_string, _("last tu"), strlen(_("last tu"))) == 0) data/pal-0.4.3/src/main.c:165:43: [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(strncmp(date_string, _("last we"), strlen(_("last we"))) == 0) data/pal-0.4.3/src/main.c:171:43: [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(strncmp(date_string, _("last th"), strlen(_("last th"))) == 0) data/pal-0.4.3/src/main.c:177:43: [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(strncmp(date_string, _("last fr"), strlen(_("last fr"))) == 0) data/pal-0.4.3/src/main.c:183:43: [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(strncmp(date_string, _("last sa"), strlen(_("last sa"))) == 0) data/pal-0.4.3/src/main.c:189:43: [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(strncmp(date_string, _("last su"), strlen(_("last su"))) == 0) data/pal-0.4.3/src/manage.c:520: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(str) > 0) data/pal-0.4.3/src/rl.c:67: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). readline_x = col + strlen( locale_prompt ); data/pal-0.4.3/src/rl.c:155: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). int matchlen = strlen( matches[0] ); data/pal-0.4.3/src/rl.c:193: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( end > strlen( rl_line_buffer ) ) ANALYSIS SUMMARY: Hits = 133 Lines analyzed = 7441 in approximately 0.22 seconds (33887 lines/second) Physical Source Lines of Code (SLOC) = 5030 Hits@level = [0] 105 [1] 46 [2] 58 [3] 5 [4] 24 [5] 0 Hits@level+ = [0+] 238 [1+] 133 [2+] 87 [3+] 29 [4+] 24 [5+] 0 Hits/KSLOC@level+ = [0+] 47.3161 [1+] 26.4414 [2+] 17.2962 [3+] 5.76541 [4+] 4.77137 [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.