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/fim-0.5.3/src/FbiStuffMatrixMarket.cpp Examining data/fim-0.5.3/src/b2ba.c Examining data/fim-0.5.3/src/FbiStuffPdf.cpp Examining data/fim-0.5.3/src/FbiStuffFbtools.cpp Examining data/fim-0.5.3/src/FbiStuffXyz.cpp Examining data/fim-0.5.3/src/FontServer.cpp Examining data/fim-0.5.3/src/help-acm.cpp Examining data/fim-0.5.3/src/CACADevice.cpp Examining data/fim-0.5.3/src/DummyDisplayDevice.h Examining data/fim-0.5.3/src/Viewport.h Examining data/fim-0.5.3/src/DisplayDevice.h Examining data/fim-0.5.3/src/fim_plugin.cpp Examining data/fim-0.5.3/src/CommandConsole-cmd.cpp Examining data/fim-0.5.3/src/Imlib2Device.h Examining data/fim-0.5.3/src/DebugConsole.h Examining data/fim-0.5.3/src/regex.c Examining data/fim-0.5.3/src/CommandConsole-var.cpp Examining data/fim-0.5.3/src/Namespace.cpp Examining data/fim-0.5.3/src/fim_limits.h Examining data/fim-0.5.3/src/FbiStuffTiff.cpp Examining data/fim-0.5.3/src/defaultConfiguration.cpp Examining data/fim-0.5.3/src/CACADevice.h Examining data/fim-0.5.3/src/FimWindow.cpp Examining data/fim-0.5.3/src/SDLDevice.h Examining data/fim-0.5.3/src/Browser.cpp Examining data/fim-0.5.3/src/grammar.h Examining data/fim-0.5.3/src/AADevice.h Examining data/fim-0.5.3/src/fim_stream.h Examining data/fim-0.5.3/src/DebugConsole.cpp Examining data/fim-0.5.3/src/CommandConsole-help.cpp Examining data/fim-0.5.3/src/Var.cpp Examining data/fim-0.5.3/src/interpreter.cpp Examining data/fim-0.5.3/src/Viewport.cpp Examining data/fim-0.5.3/src/FbiStuffPcx.cpp Examining data/fim-0.5.3/src/Command.cpp Examining data/fim-0.5.3/src/Image.h Examining data/fim-0.5.3/src/readline.cpp Examining data/fim-0.5.3/src/FontServer.h Examining data/fim-0.5.3/src/CommandConsole.cpp Examining data/fim-0.5.3/src/Namespace.h Examining data/fim-0.5.3/src/FbiStuffPs.cpp Examining data/fim-0.5.3/src/FbiStuffGif.cpp Examining data/fim-0.5.3/src/Arg.h Examining data/fim-0.5.3/src/fim_string.cpp Examining data/fim-0.5.3/src/Imlib2Device.cpp Examining data/fim-0.5.3/src/FbiStuffDjvu.cpp Examining data/fim-0.5.3/src/Image.cpp Examining data/fim-0.5.3/src/FbiStuffLoader.cpp Examining data/fim-0.5.3/src/Cache.cpp Examining data/fim-0.5.3/src/fim_stream.cpp Examining data/fim-0.5.3/src/FbiStuffBit1.cpp Examining data/fim-0.5.3/src/FbiStuffPng.cpp Examining data/fim-0.5.3/src/default_icon_byte_array.h Examining data/fim-0.5.3/src/FbiStuffText.cpp Examining data/fim-0.5.3/src/help.cpp Examining data/fim-0.5.3/src/FbiStuffJasPer.cpp Examining data/fim-0.5.3/src/FramebufferDevice.h Examining data/fim-0.5.3/src/fim.h Examining data/fim-0.5.3/src/default_font_byte_array.h Examining data/fim-0.5.3/src/readline.h Examining data/fim-0.5.3/src/FbiStuffLoader.h Examining data/fim-0.5.3/src/DisplayDevice.cpp Examining data/fim-0.5.3/src/FbiStuffList.h Examining data/fim-0.5.3/src/AADevice.cpp Examining data/fim-0.5.3/src/FramebufferDevice.cpp Examining data/fim-0.5.3/src/FbiStuffJpeg.cpp Examining data/fim-0.5.3/src/lex.h Examining data/fim-0.5.3/src/FimWindow.h Examining data/fim-0.5.3/src/Arg.cpp Examining data/fim-0.5.3/src/fim_wrappers.h Examining data/fim-0.5.3/src/FbiStuffPpm.cpp Examining data/fim-0.5.3/src/common.cpp Examining data/fim-0.5.3/src/FbiStuffMagick.cpp Examining data/fim-0.5.3/src/FbiStuffBmp.cpp Examining data/fim-0.5.3/src/common.h Examining data/fim-0.5.3/src/version.h Examining data/fim-0.5.3/src/fim_string.h Examining data/fim-0.5.3/src/Cache.h Examining data/fim-0.5.3/src/FbiStuffFbtools.h Examining data/fim-0.5.3/src/CommandConsole.h Examining data/fim-0.5.3/src/Browser.h Examining data/fim-0.5.3/src/CommandConsole-init.cpp Examining data/fim-0.5.3/src/FbiStuff.h Examining data/fim-0.5.3/src/FbiStuff.cpp Examining data/fim-0.5.3/src/examples.h Examining data/fim-0.5.3/src/SDLDevice.cpp Examining data/fim-0.5.3/src/Benchmarkable.h Examining data/fim-0.5.3/src/Command.h Examining data/fim-0.5.3/src/FbiStuffBit24.cpp Examining data/fim-0.5.3/src/fim_plugin.h Examining data/fim-0.5.3/src/Var.h Examining data/fim-0.5.3/src/fim_types.h Examining data/fim-0.5.3/src/fim.cpp Examining data/fim-0.5.3/doc/doctags.c Examining data/fim-0.5.3/scripts/maintenance/yacc2grammar.h FINAL RESULTS: data/fim-0.5.3/src/CommandConsole.cpp:2187:7: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(hfile,S_IRUSR|S_IWUSR); // we write the first .fim_history in mode -rw------- (600) data/fim-0.5.3/src/FramebufferDevice.cpp:762:10: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if ( chown(vtname, getuid(), getgid())){ data/fim-0.5.3/src/CommandConsole-cmd.cpp:405:13: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE* fd=popen(args[i].c_str(),"r"); data/fim-0.5.3/src/CommandConsole-cmd.cpp:466:12: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if( (tfd=popen(args[i].c_str(),"r")) != FIM_NULL ) data/fim-0.5.3/src/CommandConsole-cmd.cpp:588:13: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE* fd=popen(cc.c_str(),"r"); data/fim-0.5.3/src/CommandConsole-cmd.cpp:597:13: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE* fd=popen(args[i].c_str(),"r"); data/fim-0.5.3/src/CommandConsole-cmd.cpp:611:9: [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. std::system(args[i].c_str()); data/fim-0.5.3/src/CommandConsole-init.cpp:372:4: [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(rcfile,e); data/fim-0.5.3/src/CommandConsole-init.cpp:373:4: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(rcfile,"/" FIM_CNS_USR_RC_FILEPATH); data/fim-0.5.3/src/CommandConsole.cpp:2177: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(hfile,e); data/fim-0.5.3/src/CommandConsole.cpp:2178:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(hfile,"/" FIM_CNS_HIST_FILENAME); data/fim-0.5.3/src/CommandConsole.cpp:2314:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, "%s%-*.*s %s %s",prompt_, data/fim-0.5.3/src/CommandConsole.cpp:2357:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, "%s%-*.*s | %s",prompt_, chars, chars, desc+offset, hk.c_str()); data/fim-0.5.3/src/DebugConsole.cpp:178:4: [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(bp_,cs); data/fim-0.5.3/src/FbiStuff.cpp:1499:13: [4] (shell) execvp: 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. rc=execvp(cmd,argv); data/fim-0.5.3/src/FbiStuff.cpp:2037:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(command,FIM_EPR_INKSCAPE" \"%s\" --export-png \"%s\"", data/fim-0.5.3/src/FbiStuffPcx.cpp:96:3: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, x); \ data/fim-0.5.3/src/FbiStuffPdf.cpp:163:10: [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. if(-1==access(filename,R_OK)) data/fim-0.5.3/src/FbiStuffPng.cpp:101:4: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(h->cmt,s); data/fim-0.5.3/src/FontServer.cpp:198:12: [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. if (-1 == access(filename[i],R_OK)) data/fim-0.5.3/src/FontServer.cpp:233:70: [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. if(is_file(de->d_name) && regexp_match(de->d_name,"8x.*\\.psf") && access(de->d_name,R_OK)) data/fim-0.5.3/src/FramebufferDevice.cpp:573:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(fbdev_,devices_->fbnr,c2m.framebuffer); data/fim-0.5.3/src/FramebufferDevice.cpp:761:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(vtname, devices_->ttynr, vtno); data/fim-0.5.3/src/FramebufferDevice.cpp:766:15: [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. if (-1 == access(vtname, R_OK | W_OK)) { data/fim-0.5.3/src/Image.cpp:1150:2: [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(linebuffer, sizeof(linebuffer), data/fim-0.5.3/src/Imlib2Device.cpp:37:24: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define FIM_IL2_PRINTF printf data/fim-0.5.3/src/common.cpp:422:2: [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 (r, s); data/fim-0.5.3/src/common.cpp:437: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 (r+1 , s); data/fim-0.5.3/src/fim.h:206:25: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define FIM_VERB_PRINTF printf data/fim-0.5.3/src/fim_types.h:80: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 FIM_FPRINTF fprintf data/fim-0.5.3/src/regex.c:610:36: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define DEBUG_PRINT1(x) if (debug) printf (x) data/fim-0.5.3/src/regex.c:611:41: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2) data/fim-0.5.3/src/regex.c:612:45: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3) data/fim-0.5.3/src/regex.c:613:49: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4) data/fim-0.5.3/src/regex.c:5728:9: [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 (errbuf, msg); /* __STRCPY_CHECKED__ */ data/fim-0.5.3/src/Browser.cpp:1182:9: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. std::srand(time(FIM_NULL)); /* FIXME: AFAIK, effect of srand() on random_shuffle is not mandated by any standard. */ data/fim-0.5.3/src/common.cpp:485:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(clock()); data/fim-0.5.3/src/common.cpp:727: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. return getenv(name); data/fim-0.5.3/src/fim.cpp:897: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, "C:HAb?wc:uvahPqVr:m:d:g:s:T:E:f:DNhF:tfipW:o:SR", data/fim-0.5.3/src/fim_plugin.cpp:75:12: [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. haarpath=getenv(FIM_HAAR_PATH); data/fim-0.5.3/doc/doctags.c:21: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 line[LINELEN]; data/fim-0.5.3/doc/doctags.c:35:8: [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). fd = fopen(argv[0], "r"); data/fim-0.5.3/src/AADevice.cpp:375:3: [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 (&ascii_hwparms_, &aa_defparams, sizeof (struct aa_hardware_params)); data/fim-0.5.3/src/AADevice.cpp:638: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 (&ascii_hwparms_, &aa_defparams, sizeof (struct aa_hardware_params)); data/fim-0.5.3/src/CommandConsole-cmd.cpp:60:8: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). key=atoi(kstr+1); data/fim-0.5.3/src/CommandConsole.cpp:163:8: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). key=atoi(kstr+1); data/fim-0.5.3/src/CommandConsole.cpp:888:14: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). useconds=atoi(args[0].c_str()); data/fim-0.5.3/src/CommandConsole.cpp:898:13: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). seconds=atoi(args[0].c_str()); data/fim-0.5.3/src/CommandConsole.cpp:1143:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"got : 0x%x (%d)\n",c,c); data/fim-0.5.3/src/CommandConsole.cpp:2145:3: [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(&tattr,&saved_attributes_,sizeof(struct termios)); data/fim-0.5.3/src/CommandConsole.cpp:2328:14: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(str, "..."); data/fim-0.5.3/src/CommandConsole.cpp:2331:14: [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(str, "<-!->"); data/fim-0.5.3/src/DisplayDevice.cpp:136:3: [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(&tattr,&sattr,sizeof(struct termios)); data/fim-0.5.3/src/FbiStuff.cpp:151:6: [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(mmp,&mm,sizeof(mm)); data/fim-0.5.3/src/FbiStuff.cpp:172: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(dst,scanline,src->i.width * 3); data/fim-0.5.3/src/FbiStuff.cpp:203: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(&h->filter,args,sizeof(*args)); data/fim-0.5.3/src/FbiStuff.cpp:256: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(b1,s1,3); data/fim-0.5.3/src/FbiStuff.cpp:257: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(b2,s2,3); data/fim-0.5.3/src/FbiStuff.cpp:258: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(b3,s3,3); data/fim-0.5.3/src/FbiStuff.cpp:259: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(b1+3,s1,6); data/fim-0.5.3/src/FbiStuff.cpp:260: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(b2+3,s2,6); data/fim-0.5.3/src/FbiStuff.cpp:261: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(b3+3,s3,6); data/fim-0.5.3/src/FbiStuff.cpp:269: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(b1,s1+src->i.width*3-6,6); data/fim-0.5.3/src/FbiStuff.cpp:270: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(b2,s2+src->i.width*3-6,6); data/fim-0.5.3/src/FbiStuff.cpp:271: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(b3,s3+src->i.width*3-6,6); data/fim-0.5.3/src/FbiStuff.cpp:272: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(b1+3,s1+src->i.width*3-3,3); data/fim-0.5.3/src/FbiStuff.cpp:273: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(b2+3,s2+src->i.width*3-3,3); data/fim-0.5.3/src/FbiStuff.cpp:274: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(b3+3,s3+src->i.width*3-3,3); data/fim-0.5.3/src/FbiStuff.cpp:318: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(dst,scanline,src->i.width * 3); data/fim-0.5.3/src/FbiStuff.cpp:381: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(dst,scanline,src->i.width * 3); data/fim-0.5.3/src/FbiStuff.cpp:1096: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(dst,scanline,src->i.width*3); data/fim-0.5.3/src/FbiStuff.cpp:1169: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(dst,scanline,src->i.width * 3); data/fim-0.5.3/src/FbiStuff.cpp:1738:16: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). if( ( tfd=tmpfile() )!=FIM_NULL ) data/fim-0.5.3/src/FbiStuff.cpp:2284: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(larger_data + (y * diagonal + w_extra )*3 , src->data + (y-n_extra) * src->i.width * 3 , src->i.width*3); data/fim-0.5.3/src/FbiStuff.cpp:2409: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(dest->data,src->data,3 * dest->i.width * dest->i.height); /* a special case */ data/fim-0.5.3/src/FbiStuff.cpp:2416:6: [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(dest->data,src->data,3 * dest->i.width * dest->i.height); /* a special case */ data/fim-0.5.3/src/FbiStuff.cpp:2443: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(nimg,img,sizeof(struct ida_image)); data/fim-0.5.3/src/FbiStuff.cpp:2454: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(nimg->data, img->data,n); data/fim-0.5.3/src/FbiStuffGif.cpp:269:6: [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(h->row, h->il + h->w * line, h->w); data/fim-0.5.3/src/FbiStuffJpeg.cpp:453: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(h->thumbnail,ed->data,ed->size); data/fim-0.5.3/src/FbiStuffJpeg.cpp:579:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). jpeg_quality = atoi(XmTextGetString(jpeg_text)); data/fim-0.5.3/src/FbiStuffJpeg.cpp:599:5: [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(tmp,"%d",jpeg_quality); data/fim-0.5.3/src/FbiStuffLoader.cpp:129: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(extra->data,data,size); data/fim-0.5.3/src/FbiStuffPdf.cpp:160:3: [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(linkname,"/proc/self/fd/%d",fileno(fp)); data/fim-0.5.3/src/FbiStuffPdf.cpp:259: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(dst,ds->bmp->getDataPtr(),ds->bmp->getHeight()*ds->bmp->getWidth()*3); data/fim-0.5.3/src/FbiStuffPng.cpp:237: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(dst,row,3*h->w); data/fim-0.5.3/src/FbiStuffTiff.cpp:193: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(dst,h->row,3*h->width); data/fim-0.5.3/src/FontServer.cpp:141:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(fontfilename, "r"); data/fim-0.5.3/src/FontServer.cpp:273:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(fontfilename, "r"); data/fim-0.5.3/src/FramebufferDevice.cpp:557:23: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (-1 == (fb_ = open(devices_->fb0,O_RDWR /* O_WRONLY */,0))) { data/fim-0.5.3/src/FramebufferDevice.cpp:584:22: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (-1 == (fb_ = open(device,O_RDWR /* O_WRONLY */))) { data/fim-0.5.3/src/FramebufferDevice.cpp:785:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if( -1 == open(vtname,O_RDWR) ) data/fim-0.5.3/src/FramebufferDevice.cpp:856:27: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (FIM_NULL == (fp = fopen("/etc/fb.modes","r"))) data/fim-0.5.3/src/FramebufferDevice.cpp:1232:3: [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(ptr,buffer,owidth*3); data/fim-0.5.3/src/Imlib2Device.cpp:393: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[FIM_ATOX_BUFSIZE]; data/fim-0.5.3/src/Var.h:176:6: [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(buf,"%d",(int)i); data/fim-0.5.3/src/Var.h:178:6: [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(buf,"%ld",(int64_t)i); data/fim-0.5.3/src/Var.h:182:6: [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(buf,"%f",f); data/fim-0.5.3/src/common.cpp:299:6: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fs.open(filename.c_str(),std::ios::binary); data/fim-0.5.3/src/common.cpp:320:6: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fs.open(filename.c_str(),std::ios::app|std::ios::binary); data/fim-0.5.3/src/common.cpp:387:2: [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(r,"%f%c",n,c); data/fim-0.5.3/src/common.cpp:396:2: [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(r,"%c%f%c",c1,n,c2); data/fim-0.5.3/src/common.cpp:409:3: [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(r,"%d",(int)n); data/fim-0.5.3/src/common.cpp:411:3: [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(r,"%lld",(long long int)n); data/fim-0.5.3/src/common.cpp:461:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(f,O_RDONLY); data/fim-0.5.3/src/common.cpp:740:12: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). if( ( tfd=tmpfile() )!=FIM_NULL ) data/fim-0.5.3/src/common.cpp:887: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). return fopen(path,mode); data/fim-0.5.3/src/common.cpp:1002:10: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). return atoi(s); data/fim-0.5.3/src/fim.cpp:1134:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). default_vt = atoi(optarg); data/fim-0.5.3/src/fim_stream.cpp:48:35: [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. fim_char_t s[FIM_ATOX_BUFSIZE];sprintf(s,"%f",f); data/fim-0.5.3/src/fim_stream.cpp:55:35: [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. fim_char_t s[FIM_ATOX_BUFSIZE];sprintf(s,"%d",i); data/fim-0.5.3/src/fim_stream.cpp:66:5: [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(s,"%d",(int)i); data/fim-0.5.3/src/fim_stream.cpp:68:5: [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(s,"%lld",(long long int)i); data/fim-0.5.3/src/fim_string.cpp:99:3: [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(buf,"%d",i); data/fim-0.5.3/src/fim_string.cpp:108:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"%d",(int)i); data/fim-0.5.3/src/fim_string.cpp:110:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf,"%lld",(long long int)i); data/fim-0.5.3/src/fim_string.cpp:118:3: [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(buf,"%u",i); data/fim-0.5.3/src/fim_string.cpp:323:37: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). operator string::int()const{return atoi(s);} data/fim-0.5.3/src/fim_string.cpp:453:3: [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(buf,"%f",i); data/fim-0.5.3/src/fim_string.cpp:493:44: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). string::operator int (void)const{return atoi(this->c_str());} data/fim-0.5.3/src/readline.cpp:399: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). rl_outstream = fopen("/dev/null","w"); /* FIXME: seems like rl_erase_empty_line is not always working :-( */ data/fim-0.5.3/src/regex.c:120:35: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #if !defined (bzero) && !defined (bcopy) data/fim-0.5.3/src/regex.c:135:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #ifndef bcopy data/fim-0.5.3/src/regex.c:136:9: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(s, d, n) memcpy ((d), (s), (n)) data/fim-0.5.3/src/regex.c:136:24: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. #define bcopy(s, d, n) memcpy ((d), (s), (n)) data/fim-0.5.3/src/regex.c:169: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. static char re_syntax_table[CHAR_SET_SIZE]; data/fim-0.5.3/src/regex.c:309:4: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy (source, destination, osize), \ data/fim-0.5.3/src/regex.c:2188:21: [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 str[CHAR_CLASS_MAX_LENGTH + 1]; data/fim-0.5.3/src/regex.c:3073:34: [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. range_start = ((const unsigned char *) p)[-2]; data/fim-0.5.3/src/regex.c:3074:34: [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. range_end = ((const unsigned char *) p)[0]; data/fim-0.5.3/src/regex.c:5498:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. return (char *) gettext (re_error_msgid[(int) ret]); data/fim-0.5.3/src/Browser.cpp:330: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). sl = strlen(ss); data/fim-0.5.3/src/Browser.cpp:1034: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). int sl = strlen(nf.c_str()); data/fim-0.5.3/src/Browser.cpp:1398: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). sl = strlen(s); data/fim-0.5.3/src/CommandConsole-cmd.cpp:52: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). l=strlen(kstr); data/fim-0.5.3/src/CommandConsole-init.cpp:95: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). dopts=device.substr(dosso+strlen(FIM_SYM_DEVOPTS_SEP_STR),device.length()).c_str(); data/fim-0.5.3/src/CommandConsole-init.cpp:370:11: [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(e && strlen(e)<FIM_PATH_MAX-8)//strlen("/" FIM_CNS_USR_RC_FILEPATH)+2 data/fim-0.5.3/src/CommandConsole.cpp:161: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(kstr)>=2 && isdigit(kstr[0]) && isdigit(kstr[1])) data/fim-0.5.3/src/CommandConsole.cpp:626:26: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). #define istrncpy(x,y,z) {strncpy(x,y,z-1);x[z-1]='\0';} data/fim-0.5.3/src/CommandConsole.cpp:768:29: [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). r=write(fim_pipedesc[1],s,strlen(s)); data/fim-0.5.3/src/CommandConsole.cpp:775: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). if((size_t)r!=strlen(s)) data/fim-0.5.3/src/CommandConsole.cpp:861: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). sl=strlen(ex.c_str()); data/fim-0.5.3/src/CommandConsole.cpp:889:4: [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. usleep(useconds); data/fim-0.5.3/src/CommandConsole.cpp:1803: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). if(!r || !strlen(r)) data/fim-0.5.3/src/CommandConsole.cpp:2032: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). if(cmd.c_str()[strlen(cmd.c_str())-1]!=FIM_SYM_SEMICOLON) data/fim-0.5.3/src/CommandConsole.cpp:2175: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). if(e && strlen(e)<FIM_PATH_MAX-14)//strlen(FIM_CNS_HIST_FILENAME)+2 data/fim-0.5.3/src/CommandConsole.cpp:2336:13: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(str, "!"); data/fim-0.5.3/src/DebugConsole.cpp:74:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf,line_[f_],n); data/fim-0.5.3/src/DebugConsole.cpp:108:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf,line_[i],t); data/fim-0.5.3/src/DebugConsole.cpp:157: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). nc=strlen(cs); data/fim-0.5.3/src/DebugConsole.cpp:167: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). else nl+=(strlen(cs)+ccol_)/lwidth_; // single line_, with no terminators data/fim-0.5.3/src/DebugConsole.cpp:194:11: [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). ccol_=strlen(line_[cline_]); // we update the current (right after last) column data/fim-0.5.3/src/DebugConsole.cpp:195:10: [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). bp_+=strlen(bp_); // the buffer_ points to the current column data/fim-0.5.3/src/DebugConsole.cpp:199:11: [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). ccol_=strlen(bp_); // we update the current (right after last) column data/fim-0.5.3/src/DisplayDevice.cpp:95:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read(cc.fim_stdin_, c, 4); data/fim-0.5.3/src/DisplayDevice.cpp:103:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r=read(fim_stdin_,&c,4); //up to four chars should suffice data/fim-0.5.3/src/DisplayDevice.cpp:143:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r=read(cc.fim_stdin_,&c,1); if(r>0&&c==0x1b){rc=read(0,&c,3);c=(0x1b)+(c<<8);/* we should do something with rc now */} data/fim-0.5.3/src/DisplayDevice.cpp:143:51: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r=read(cc.fim_stdin_,&c,1); if(r>0&&c==0x1b){rc=read(0,&c,3);c=(0x1b)+(c<<8);/* we should do something with rc now */} data/fim-0.5.3/src/FbiStuff.cpp:1522: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). sl=strlen(byte_stream); data/fim-0.5.3/src/FbiStuff.cpp:1697:50: [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( pn && regexp_match(pn,re.c_str(),1) && strlen(pn)>0 && pn[strlen(pn)-1] != FIM_CNS_DIRSEP_CHAR ) /* skip directories */ data/fim-0.5.3/src/FbiStuff.cpp:1697:69: [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( pn && regexp_match(pn,re.c_str(),1) && strlen(pn)>0 && pn[strlen(pn)-1] != FIM_CNS_DIRSEP_CHAR ) /* skip directories */ data/fim-0.5.3/src/FbiStuff.cpp:1790: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). int sl = strlen(sm.c_str()); data/fim-0.5.3/src/FbiStuff.cpp:2133:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). loader->read(img->data + img->i.width * 3 * y, y, data); data/fim-0.5.3/src/FbiStuff.cpp:2138:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). loader->read(img->data + img->i.width * 3 * y, y, data); data/fim-0.5.3/src/FbiStuffBit1.cpp:104:18: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fim_byte_t c = fgetc(h->fp); data/fim-0.5.3/src/FbiStuffBit24.cpp:105:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). *(dst++) = fgetc(h->fp); data/fim-0.5.3/src/FbiStuffBit24.cpp:106:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). *(dst++) = fgetc(h->fp); data/fim-0.5.3/src/FbiStuffBit24.cpp:107:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). *(dst++) = fgetc(h->fp); data/fim-0.5.3/src/FbiStuffLoader.h:89:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void (*read)(fim_byte_t *dst, unsigned int line, void *data); data/fim-0.5.3/src/FbiStuffMagick.cpp:91: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). fim_size_t fnl=strlen(filename); data/fim-0.5.3/src/FbiStuffMagick.cpp:110: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(filename)>MaxTextExtent-1) data/fim-0.5.3/src/FbiStuffMagick.cpp:112:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(ms.image_info->filename,filename,MaxTextExtent-1); data/fim-0.5.3/src/FbiStuffMatrixMarket.cpp:145:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read: mm_read, data/fim-0.5.3/src/FbiStuffPng.cpp:86: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). if(fs.c_str() && strlen(fs.c_str())) data/fim-0.5.3/src/FbiStuffPng.cpp:91: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). h->cmt = (char*) calloc(strlen(s)+1,1); data/fim-0.5.3/src/FbiStuffPng.cpp:94: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). h->cmt = (char*) realloc(h->cmt,strlen(h->cmt)+strlen(s)+1); data/fim-0.5.3/src/FbiStuffPng.cpp:94: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). h->cmt = (char*) realloc(h->cmt,strlen(h->cmt)+strlen(s)+1); data/fim-0.5.3/src/FbiStuffPng.cpp:96:5: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(h->cmt," "); data/fim-0.5.3/src/FbiStuffPng.cpp:265: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). load_add_extra(h->i,EXTRA_COMMENT,(fim_byte_t*)h->cmt,strlen(h->cmt)); data/fim-0.5.3/src/FbiStuffText.cpp:173:17: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while( ( fr = fgetc(h->fp) ) != EOF && cc < h->maxc ) data/fim-0.5.3/src/FontServer.cpp:132: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(fontfilename)>3 && 0 == strcmp(fontfilename+strlen(fontfilename)-3,".gz")) data/fim-0.5.3/src/FontServer.cpp:132:58: [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(fontfilename)>3 && 0 == strcmp(fontfilename+strlen(fontfilename)-3,".gz")) data/fim-0.5.3/src/FontServer.cpp:147:6: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (fgetc(fp) != 0x36 || fgetc(fp) != 0x04) data/fim-0.5.3/src/FontServer.cpp:147:27: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (fgetc(fp) != 0x36 || fgetc(fp) != 0x04) data/fim-0.5.3/src/FontServer.cpp:238:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fontfilenameb,nf.c_str(),FIM_PATH_MAX-1); data/fim-0.5.3/src/FontServer.cpp:264: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). h = fontfilename+strlen(fontfilename)-3; data/fim-0.5.3/src/FontServer.cpp:283:8: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). m0=fgetc(fp); data/fim-0.5.3/src/FontServer.cpp:284:8: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). m1=fgetc(fp); data/fim-0.5.3/src/FontServer.cpp:303:5: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fgetc(fp); data/fim-0.5.3/src/FontServer.cpp:306:18: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). f_->height = fgetc(fp); data/fim-0.5.3/src/FramebufferDevice.cpp:881:12: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (1 == sscanf(line, " hsync %15s",value) && data/fim-0.5.3/src/FramebufferDevice.cpp:884:12: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (1 == sscanf(line, " vsync %15s",value) && data/fim-0.5.3/src/FramebufferDevice.cpp:887:12: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (1 == sscanf(line, " csync %15s",value) && data/fim-0.5.3/src/FramebufferDevice.cpp:890:12: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (1 == sscanf(line, " extsync %15s",value) && data/fim-0.5.3/src/FramebufferDevice.cpp:893:12: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (1 == sscanf(line, " laced %15s",value) && data/fim-0.5.3/src/FramebufferDevice.cpp:896:12: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (1 == sscanf(line, " double %15s",value) && data/fim-0.5.3/src/FramebufferDevice.cpp:1023: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). len = strlen(lines[i]); data/fim-0.5.3/src/FramebufferDevice.cpp:1745:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(columns[cline]+ccol,p,w); data/fim-0.5.3/src/Image.cpp:998: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(sp+1)>=4) data/fim-0.5.3/src/Image.cpp:1013: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). snprintf(clb+strlen(clb), fcpp-vipp+1, "%s", vipp ); data/fim-0.5.3/src/Image.cpp:1014: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). rbc -= strlen(clbp); clbp += strlen(clbp); data/fim-0.5.3/src/Image.cpp:1014: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). rbc -= strlen(clbp); clbp += strlen(clbp); data/fim-0.5.3/src/Image.cpp:1045: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). sp += strlen(fcp)+strlen(vip)+2; data/fim-0.5.3/src/Image.cpp:1045:25: [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). sp += strlen(fcp)+strlen(vip)+2; data/fim-0.5.3/src/Image.cpp:1051: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(sp+1)>=3) data/fim-0.5.3/src/Image.cpp:1059: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). sp += strlen(fcp)+strlen(vip)+strlen(bcp)+3; data/fim-0.5.3/src/Image.cpp:1059:25: [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). sp += strlen(fcp)+strlen(vip)+strlen(bcp)+3; data/fim-0.5.3/src/Image.cpp:1059: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). sp += strlen(fcp)+strlen(vip)+strlen(bcp)+3; data/fim-0.5.3/src/Image.cpp:1076:11: [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). rbc -= strlen(clbp); clbp += strlen(clbp); data/fim-0.5.3/src/Image.cpp:1076: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). rbc -= strlen(clbp); clbp += strlen(clbp); data/fim-0.5.3/src/Image.cpp:1078:11: [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). rbc -= strlen(clbp); clbp += strlen(clbp); data/fim-0.5.3/src/Image.cpp:1078: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). rbc -= strlen(clbp); clbp += strlen(clbp); data/fim-0.5.3/src/SDLDevice.cpp:965:5: [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. usleep((useconds_t)(sms*1000)),ms-=sms; data/fim-0.5.3/src/SDLDevice.cpp:972:3: [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. usleep((useconds_t)(sms*1000)),ms-=sms; data/fim-0.5.3/src/Viewport.cpp:293: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). int sl = strlen(str), rw = viewport_width() / fw, wh = viewport_height(); data/fim-0.5.3/src/Viewport.cpp:456: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). int sl = strlen(cmnts), rw = viewport_width() / fw, wh = viewport_height(); data/fim-0.5.3/src/Viewport.cpp:804: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). ps=((ss=args[1].c_str()) && *ss && ((ss[strlen(ss)-1])=='%')); data/fim-0.5.3/src/b2ba.c:25:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while(read(0,&byte,1)==1) data/fim-0.5.3/src/common.cpp:71:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf,arg.c_str(),FIM_PATH_MAX-1); data/fim-0.5.3/src/common.cpp:104: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). return strlen(str); data/fim-0.5.3/src/common.cpp:167:25: [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(!str || !f || !t || strlen(f)-strlen(t)) data/fim-0.5.3/src/common.cpp:167: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). if(!str || !f || !t || strlen(f)-strlen(t)) data/fim-0.5.3/src/common.cpp:170: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). tl = strlen(f);//table length data/fim-0.5.3/src/common.cpp:278:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((nrb=read(fd,buf+rb,inc))>0) data/fim-0.5.3/src/common.cpp:420: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). fim_char_t *r = (fim_char_t*) fim_malloc (strlen (s) + 1); data/fim-0.5.3/src/common.cpp:432: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). fim_char_t *r = (fim_char_t*) fim_malloc ((l=strlen (s)) + 3); data/fim-0.5.3/src/common.cpp:438:3: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat (r+1+l,"/"); data/fim-0.5.3/src/common.cpp:450:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(r,s,l); data/fim-0.5.3/src/common.cpp:464:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(fd,w,sizeof(int))==sizeof(int)) data/fim-0.5.3/src/common.cpp:505: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). if(!r || !strlen(r)) data/fim-0.5.3/src/common.cpp:574: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(s[strlen(s)-1]=='\n') data/fim-0.5.3/src/common.cpp:591: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). const fim_char_t *b=s;int l=strlen(s); data/fim-0.5.3/src/common.cpp:642: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). n+=(strlen(s))/cols; // we count the last substring chars (with no wrapping exceptions) data/fim-0.5.3/src/common.cpp:935:9: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return fgetc(stream); data/fim-0.5.3/src/common.cpp:982: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). size_t sl = strlen(s); data/fim-0.5.3/src/fim_string.cpp:232: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). int tlen=strlen(this->s), data/fim-0.5.3/src/fim_string.cpp:233: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). slen=strlen(s.c_str()), data/fim-0.5.3/src/fim_string.cpp:235:3: [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. strncat(this->s+tlen,s.c_str(),slen); data/fim-0.5.3/src/fim_string.cpp:251:10: [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 strlen(s); data/fim-0.5.3/src/fim_string.cpp:288: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). l=strlen(s);//at least 1, as the string is not empty data/fim-0.5.3/src/fim_string.cpp:298:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(this->s,s,r); //r can be longer than strlen(s) data/fim-0.5.3/src/fim_string.cpp:551: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). sl=strlen(s); data/fim-0.5.3/src/fim_string.cpp:588: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). return c+(strlen(f)>0); data/fim-0.5.3/src/fim_string.cpp:608: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). if(!*s)se=s+strlen(s); data/fim-0.5.3/src/readline.cpp:185: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). w=min(strlen(matches[i])+1,(size_t)f); data/fim-0.5.3/src/readline.cpp:187:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer+l,matches[i],w); data/fim-0.5.3/src/readline.cpp:188: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). w=strlen(buffer+l);l+=w;f-=w;} data/fim-0.5.3/src/readline.cpp:189:11: [1] (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 character. if(f>0){strcpy(buffer+l," ");--f;++l;} data/fim-0.5.3/src/readline.cpp:346: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). rl_point=strlen(hs); data/fim-0.5.3/src/regex.c:5492:27: [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). ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); data/fim-0.5.3/src/regex.c:5509: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). const int len = strlen (s); data/fim-0.5.3/src/regex.c:5608: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). ret = regex_compile (pattern, strlen (pattern), syntax, preg); data/fim-0.5.3/src/regex.c:5643: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). int len = strlen (string); data/fim-0.5.3/src/regex.c:5718: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). msg_size = strlen (msg) + 1; /* Includes the null. */ data/fim-0.5.3/src/regex.c:5724:11: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (errbuf, msg, errbuf_size - 1); ANALYSIS SUMMARY: Hits = 255 Lines analyzed = 41633 in approximately 1.17 seconds (35654 lines/second) Physical Source Lines of Code (SLOC) = 29618 Hits@level = [0] 164 [1] 124 [2] 91 [3] 5 [4] 33 [5] 2 Hits@level+ = [0+] 419 [1+] 255 [2+] 131 [3+] 40 [4+] 35 [5+] 2 Hits/KSLOC@level+ = [0+] 14.1468 [1+] 8.60963 [2+] 4.42299 [3+] 1.35053 [4+] 1.18171 [5+] 0.0675265 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.