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/gource-0.51/src/dirnode.cpp Examining data/gource-0.51/src/bloom.h Examining data/gource-0.51/src/action.cpp Examining data/gource-0.51/src/caption.h Examining data/gource-0.51/src/zoomcamera.cpp Examining data/gource-0.51/src/pawn.h Examining data/gource-0.51/src/key.h Examining data/gource-0.51/src/user.h Examining data/gource-0.51/src/textbox.h Examining data/gource-0.51/src/formats/custom.cpp Examining data/gource-0.51/src/formats/gitraw.h Examining data/gource-0.51/src/formats/cvs2cl.h Examining data/gource-0.51/src/formats/gitraw.cpp Examining data/gource-0.51/src/formats/cvs-exp.cpp Examining data/gource-0.51/src/formats/custom.h Examining data/gource-0.51/src/formats/commitlog.cpp Examining data/gource-0.51/src/formats/bzr.cpp Examining data/gource-0.51/src/formats/apache.cpp Examining data/gource-0.51/src/formats/bzr.h Examining data/gource-0.51/src/formats/svn.h Examining data/gource-0.51/src/formats/apache.h Examining data/gource-0.51/src/formats/commitlog.h Examining data/gource-0.51/src/formats/hg.h Examining data/gource-0.51/src/formats/git.cpp Examining data/gource-0.51/src/formats/svn.cpp Examining data/gource-0.51/src/formats/cvs-exp.h Examining data/gource-0.51/src/formats/hg.cpp Examining data/gource-0.51/src/formats/cvs2cl.cpp Examining data/gource-0.51/src/formats/git.h Examining data/gource-0.51/src/slider.h Examining data/gource-0.51/src/gource.h Examining data/gource-0.51/src/key.cpp Examining data/gource-0.51/src/action.h Examining data/gource-0.51/src/core/png_writer.cpp Examining data/gource-0.51/src/core/display.cpp Examining data/gource-0.51/src/core/fxfont.cpp Examining data/gource-0.51/src/core/shader.cc Examining data/gource-0.51/src/core/timer.h Examining data/gource-0.51/src/core/timer.cpp Examining data/gource-0.51/src/core/logger.h Examining data/gource-0.51/src/core/plane.h Examining data/gource-0.51/src/core/quadtree.cpp Examining data/gource-0.51/src/core/resource.h Examining data/gource-0.51/src/core/conffile.h Examining data/gource-0.51/src/core/mousecursor.cpp Examining data/gource-0.51/src/core/png_writer.h Examining data/gource-0.51/src/core/sdlapp.cpp Examining data/gource-0.51/src/core/resource.cpp Examining data/gource-0.51/src/core/texture.h Examining data/gource-0.51/src/core/bounds.h Examining data/gource-0.51/src/core/vbo.h Examining data/gource-0.51/src/core/settings.h Examining data/gource-0.51/src/core/pi.h Examining data/gource-0.51/src/core/tga.h Examining data/gource-0.51/src/core/ftgl/FTUnicode.h Examining data/gource-0.51/src/core/vectors.h Examining data/gource-0.51/src/core/fxfont.h Examining data/gource-0.51/src/core/seeklog.h Examining data/gource-0.51/src/core/sdlapp.h Examining data/gource-0.51/src/core/shader.h Examining data/gource-0.51/src/core/frustum.cpp Examining data/gource-0.51/src/core/gl.h Examining data/gource-0.51/src/core/shader_common.cpp Examining data/gource-0.51/src/core/tga.cpp Examining data/gource-0.51/src/core/plane.cpp Examining data/gource-0.51/src/core/settings.cpp Examining data/gource-0.51/src/core/timezone.cpp Examining data/gource-0.51/src/core/logger.cpp Examining data/gource-0.51/src/core/ppm.cpp Examining data/gource-0.51/src/core/regex.cpp Examining data/gource-0.51/src/core/timezone.h Examining data/gource-0.51/src/core/display.h Examining data/gource-0.51/src/core/frustum.h Examining data/gource-0.51/src/core/ppm.h Examining data/gource-0.51/src/core/mousecursor.h Examining data/gource-0.51/src/core/vbo.cpp Examining data/gource-0.51/src/core/quadtree.h Examining data/gource-0.51/src/core/stringhash.h Examining data/gource-0.51/src/core/texture.cpp Examining data/gource-0.51/src/core/shader_common.h Examining data/gource-0.51/src/core/utf8/checked.h Examining data/gource-0.51/src/core/utf8/unchecked.h Examining data/gource-0.51/src/core/utf8/utf8.h Examining data/gource-0.51/src/core/utf8/core.h Examining data/gource-0.51/src/core/regex.h Examining data/gource-0.51/src/core/shader.cpp Examining data/gource-0.51/src/core/seeklog.cpp Examining data/gource-0.51/src/core/vectors.cpp Examining data/gource-0.51/src/core/stringhash.cpp Examining data/gource-0.51/src/core/conffile.cpp Examining data/gource-0.51/src/slider.cpp Examining data/gource-0.51/src/gource_shell.cpp Examining data/gource-0.51/src/main.h Examining data/gource-0.51/src/logmill.h Examining data/gource-0.51/src/tinyxml/tinystr.cpp Examining data/gource-0.51/src/tinyxml/tinyxmlparser.cpp Examining data/gource-0.51/src/tinyxml/tinystr.h Examining data/gource-0.51/src/tinyxml/tinyxmlerror.cpp Examining data/gource-0.51/src/tinyxml/tinyxml.cpp Examining data/gource-0.51/src/tinyxml/tinyxml.h Examining data/gource-0.51/src/dirnode.h Examining data/gource-0.51/src/spline.h Examining data/gource-0.51/src/zoomcamera.h Examining data/gource-0.51/src/main.cpp Examining data/gource-0.51/src/logmill.cpp Examining data/gource-0.51/src/caption.cpp Examining data/gource-0.51/src/file.cpp Examining data/gource-0.51/src/gource_settings.cpp Examining data/gource-0.51/src/gource_settings.h Examining data/gource-0.51/src/pawn.cpp Examining data/gource-0.51/src/file.h Examining data/gource-0.51/src/bloom.cpp Examining data/gource-0.51/src/user.cpp Examining data/gource-0.51/src/gource.cpp Examining data/gource-0.51/src/gource_shell.h Examining data/gource-0.51/src/textbox.cpp Examining data/gource-0.51/src/spline.cpp FINAL RESULTS: data/gource-0.51/src/core/fxfont.cpp:551: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, 4096, str, vl); data/gource-0.51/src/core/logger.cpp:55:27: [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. int string_size = vsnprintf(buffer, sizeof(msgbuff), str, vl) + 1; \ data/gource-0.51/src/core/logger.cpp:59:27: [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. string_size = vsnprintf(buffer, string_size, str, vl); \ data/gource-0.51/src/core/sdlapp.cpp:81:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(consoleTitle, "%s Console", gSDLAppTitle.c_str()); data/gource-0.51/src/core/sdlapp.cpp:84:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(consoleTitle, "%s Console %d", gSDLAppTitle.c_str(), ++console_suffix); data/gource-0.51/src/core/sdlapp.h:75:13: [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(msg, 65536, str, vl); data/gource-0.51/src/core/shader_common.cpp:100:27: [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. int string_size = vsnprintf(sub, sizeof(sub), value, vl); data/gource-0.51/src/core/shader_common.cpp:104:27: [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. string_size = vsnprintf(buffer, string_size, value, vl); data/gource-0.51/src/core/shader_common.cpp:141:27: [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. int string_size = vsnprintf(sub, sizeof(sub), value, vl); data/gource-0.51/src/core/shader_common.cpp:145:27: [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. string_size = vsnprintf(buffer, string_size, value, vl); data/gource-0.51/src/core/shader_common.cpp:1166:27: [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. int string_size = vsnprintf(sub, sizeof(sub), value, vl); data/gource-0.51/src/core/shader_common.cpp:1170:27: [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. string_size = vsnprintf(buffer, string_size, value, vl); data/gource-0.51/src/formats/commitlog.cpp:94:14: [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. int rc = system(command.c_str()); data/gource-0.51/src/formats/commitlog.cpp:278:8: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). if(mktemp(tmplate) < 0) return false; data/gource-0.51/src/gource.cpp:2196:9: [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(msgbuff, 1024, str, vl); data/gource-0.51/src/tinyxml/tinyxml.h:70:26: [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. #define TIXML_SNPRINTF _snprintf data/gource-0.51/src/tinyxml/tinyxml.h:71:26: [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. #define TIXML_SSCANF sscanf data/gource-0.51/src/tinyxml/tinyxml.h:75:26: [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. #define TIXML_SNPRINTF snprintf data/gource-0.51/src/tinyxml/tinyxml.h:76:26: [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. #define TIXML_SSCANF sscanf data/gource-0.51/src/tinyxml/tinyxml.h:78:26: [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. #define TIXML_SNPRINTF snprintf data/gource-0.51/src/tinyxml/tinyxml.h:79:26: [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. #define TIXML_SSCANF sscanf data/gource-0.51/src/tinyxml/tinyxmlparser.cpp:36:21: [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 TIXML_LOG printf data/gource-0.51/src/core/sdlapp.cpp:66:15: [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. } else if(getenv("TERM") != 0) { data/gource-0.51/src/core/timezone.cpp:13:28: [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* current_tz_env = getenv("TZ"); data/gource-0.51/src/formats/svn.cpp:121:32: [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* current_tz_env = getenv("TZ"); data/gource-0.51/src/gource_settings.cpp:1281:13: [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(time(0)); data/gource-0.51/src/bloom.h:37: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 padding[24]; data/gource-0.51/src/core/conffile.cpp:88: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 floattostr[256]; data/gource-0.51/src/core/conffile.cpp:95: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 inttostr[256]; data/gource-0.51/src/core/conffile.cpp:106: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 vectostr[256]; data/gource-0.51/src/core/conffile.cpp:113: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 vectostr[256]; data/gource-0.51/src/core/conffile.cpp:120: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 vectostr[256]; data/gource-0.51/src/core/conffile.cpp:139:12: [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(value.c_str()); data/gource-0.51/src/core/conffile.cpp:464:9: [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). out.open(conffile.c_str()); data/gource-0.51/src/core/conffile.cpp:512: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 buff[1024]; data/gource-0.51/src/core/conffile.cpp:800:13: [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 linebuff[256]; data/gource-0.51/src/core/conffile.cpp:826:13: [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 linebuff[256]; data/gource-0.51/src/core/display.cpp:125: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 glewerr[1024]; data/gource-0.51/src/core/ftgl/FTUnicode.h:151:18: [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 const char utf8bytes[256]; data/gource-0.51/src/core/fxfont.cpp:546: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[4096]; data/gource-0.51/src/core/logger.cpp:49: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 msgbuff[65536]; \ data/gource-0.51/src/core/png_writer.cpp:41:17: [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). bool PNGWriter::open(const std::string& filename) { data/gource-0.51/src/core/png_writer.cpp:64:9: [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(!open(filename)) return; data/gource-0.51/src/core/png_writer.cpp:142:19: [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(!writer.open(filename)) { data/gource-0.51/src/core/png_writer.h:45:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). bool open(const std::string& filename); data/gource-0.51/src/core/ppm.cpp:175: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(ppmheader, "P6\n%d %d 255\n", display.width, display.height); data/gource-0.51/src/core/ppm.h:75: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 ppmheader[1024]; data/gource-0.51/src/core/regex.cpp:118: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). if(new_str[j] == '$' && atoi(&(new_str[j+1])) == i) { data/gource-0.51/src/core/sdlapp.cpp:79: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 consoleTitle[512]; data/gource-0.51/src/core/sdlapp.cpp:190: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 szAppPath[MAX_PATH]; data/gource-0.51/src/core/sdlapp.cpp:205: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 cwd_buff[1024]; data/gource-0.51/src/core/sdlapp.cpp:294:29: [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). int width = atoi(widthstr.c_str()); data/gource-0.51/src/core/sdlapp.cpp:295:30: [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). int height = atoi(heightstr.c_str()); data/gource-0.51/src/core/sdlapp.h:72: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 msg[65536]; data/gource-0.51/src/core/settings.cpp:91: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 viewportbuff[256]; data/gource-0.51/src/core/settings.cpp:105:13: [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 windowbuff[256]; data/gource-0.51/src/core/settings.cpp:131: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). x = atoi(matches[0].c_str()); data/gource-0.51/src/core/settings.cpp:132: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). y = atoi(matches[1].c_str()); data/gource-0.51/src/core/settings.cpp:145: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). x = atoi(matches[0].c_str()); data/gource-0.51/src/core/settings.cpp:146: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). y = atoi(matches[1].c_str()); data/gource-0.51/src/core/settings.cpp:289:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). timeinfo.tm_year = atoi(results[0].c_str()) - 1900; data/gource-0.51/src/core/settings.cpp:290:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). timeinfo.tm_mon = atoi(results[1].c_str()) - 1; data/gource-0.51/src/core/settings.cpp:291:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). timeinfo.tm_mday = atoi(results[2].c_str()); data/gource-0.51/src/core/settings.cpp:295:28: [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). timeinfo.tm_hour = atoi(results[3].c_str()); data/gource-0.51/src/core/settings.cpp:296:28: [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). timeinfo.tm_min = atoi(results[4].c_str()); data/gource-0.51/src/core/settings.cpp:298:32: [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). timeinfo.tm_sec = atoi(results[5].c_str()); data/gource-0.51/src/core/settings.cpp:305:23: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int tz_hour = atoi(results[7].c_str()); data/gource-0.51/src/core/settings.cpp:309:22: [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). tz_min = atoi(results[8].c_str()); data/gource-0.51/src/core/shader.cc:116: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 info_log[info_log_length]; data/gource-0.51/src/core/shader.cc:256: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 info_log[info_log_length]; data/gource-0.51/src/core/shader_common.cpp:95: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 sub[65536]; data/gource-0.51/src/core/shader_common.cpp:136: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 sub[65536]; data/gource-0.51/src/core/shader_common.cpp:246: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 buff[256]; data/gource-0.51/src/core/shader_common.cpp:278: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 buff[256]; data/gource-0.51/src/core/shader_common.cpp:309: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 buff[256]; data/gource-0.51/src/core/shader_common.cpp:338: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 buff[256]; data/gource-0.51/src/core/shader_common.cpp:370: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 buff[256]; data/gource-0.51/src/core/shader_common.cpp:396: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 buff[256]; data/gource-0.51/src/core/shader_common.cpp:428: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 buff[256]; data/gource-0.51/src/core/shader_common.cpp:459: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 buff[256]; data/gource-0.51/src/core/shader_common.cpp:490: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 buff[1024]; data/gource-0.51/src/core/shader_common.cpp:525: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 buff[1024]; data/gource-0.51/src/core/shader_common.cpp:614: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 buff[1024]; data/gource-0.51/src/core/shader_common.cpp:706: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 buff[1024]; data/gource-0.51/src/core/shader_common.cpp:796: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 buff[1024]; data/gource-0.51/src/core/shader_common.cpp:827: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 line_detail[1024]; data/gource-0.51/src/core/shader_common.cpp:850:19: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int line_no = atoi(matches[0].c_str()); data/gource-0.51/src/core/shader_common.cpp:853:32: [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). int redefine_line_no = atoi(matches[0].c_str()); data/gource-0.51/src/core/shader_common.cpp:964:19: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). version = atoi(matches[0].c_str()); data/gource-0.51/src/core/shader_common.cpp:987: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). size_t uniform_length = atoi(matches[2].c_str()); data/gource-0.51/src/core/shader_common.cpp:1161: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 sub[65536]; data/gource-0.51/src/core/texture.cpp:65: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 res_name[256]; data/gource-0.51/src/core/tga.cpp:79:17: [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). bool TGAWriter::open(const std::string& filename) { data/gource-0.51/src/core/tga.cpp:102:9: [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(!open(filename)) return; data/gource-0.51/src/core/tga.cpp:117: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. const char tga_header[12] = { 0, 0, image_type, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; data/gource-0.51/src/core/tga.cpp:230:19: [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(!writer.open(filename)) { data/gource-0.51/src/core/tga.h:60:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). bool open(const std::string& filename); data/gource-0.51/src/formats/apache.cpp:58:18: [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). int day = atoi(matches[0].c_str()); data/gource-0.51/src/formats/apache.cpp:59:18: [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). int year = atoi(matches[2].c_str()); data/gource-0.51/src/formats/apache.cpp:60:18: [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). int hour = atoi(matches[3].c_str()); data/gource-0.51/src/formats/apache.cpp:61:18: [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). int minute = atoi(matches[4].c_str()); data/gource-0.51/src/formats/apache.cpp:62:18: [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). int second = atoi(matches[5].c_str()); data/gource-0.51/src/formats/apache.cpp:94:21: [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). int code = atoi(matches[3].c_str()); data/gource-0.51/src/formats/apache.cpp:95:21: [2] (integer) atol: 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). int bytes = atol(matches[4].c_str()); data/gource-0.51/src/formats/bzr.cpp:74: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 cmd_buff[2048]; data/gource-0.51/src/formats/bzr.cpp:103: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). year = atoi(entries[2].c_str()); data/gource-0.51/src/formats/bzr.cpp:104: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). month = atoi(entries[3].c_str()); data/gource-0.51/src/formats/bzr.cpp:105: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). day = atoi(entries[4].c_str()); data/gource-0.51/src/formats/commitlog.cpp:102:5: [2] (buffer) TCHAR: 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. TCHAR exePath[MAX_PATH]; data/gource-0.51/src/formats/commitlog.cpp:274: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 tmplate[1024]; data/gource-0.51/src/formats/commitlog.cpp:280:8: [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). if(mkstemp(tmplate) < 0) return false; data/gource-0.51/src/formats/custom.cpp:57:28: [2] (integer) atol: 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). long timestamp = atol(entries[0].c_str()); data/gource-0.51/src/formats/cvs-exp.cpp:74:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). time_str.tm_year = atoi(entries[0].c_str()) - 1900; data/gource-0.51/src/formats/cvs-exp.cpp:75:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). time_str.tm_mon = atoi(entries[1].c_str()) - 1; data/gource-0.51/src/formats/cvs-exp.cpp:76:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). time_str.tm_mday = atoi(entries[2].c_str()); data/gource-0.51/src/formats/cvs-exp.cpp:77:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). time_str.tm_hour = atoi(entries[3].c_str()); data/gource-0.51/src/formats/cvs-exp.cpp:78:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). time_str.tm_min = atoi(entries[4].c_str()); data/gource-0.51/src/formats/cvs-exp.cpp:79:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). time_str.tm_sec = atoi(entries[5].c_str()); data/gource-0.51/src/formats/cvs2cl.cpp:120:25: [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). time_str.tm_year = atoi(entries[0].c_str()) - 1900; data/gource-0.51/src/formats/cvs2cl.cpp:121:25: [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). time_str.tm_mon = atoi(entries[1].c_str()) - 1; data/gource-0.51/src/formats/cvs2cl.cpp:122:25: [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). time_str.tm_mday = atoi(entries[2].c_str()); data/gource-0.51/src/formats/cvs2cl.cpp:123:25: [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). time_str.tm_hour = atoi(entries[3].c_str()); data/gource-0.51/src/formats/cvs2cl.cpp:124:25: [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). time_str.tm_min = atoi(entries[4].c_str()); data/gource-0.51/src/formats/cvs2cl.cpp:125:25: [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). time_str.tm_sec = atoi(entries[5].c_str()); data/gource-0.51/src/formats/git.cpp:42: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 cmd_buff[2048]; data/gource-0.51/src/formats/git.cpp:64: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 version_str[1024]; data/gource-0.51/src/formats/git.cpp:74:25: [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). git_version_major = atoi(entries[0].c_str()); data/gource-0.51/src/formats/git.cpp:77:29: [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). git_version_minor = atoi(entries[1].c_str()); data/gource-0.51/src/formats/git.cpp:81:29: [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). git_version_patch = atoi(entries[2].c_str()); data/gource-0.51/src/formats/git.cpp:139: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 cwd_buff[1024]; data/gource-0.51/src/formats/git.cpp:167: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 cmd_buff[2048]; data/gource-0.51/src/formats/git.cpp:184: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 firstBytes[9]; data/gource-0.51/src/formats/git.cpp:223:32: [2] (integer) atol: 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). commit.timestamp = atol(line.c_str()); data/gource-0.51/src/formats/gitraw.cpp:72:24: [2] (integer) atol: 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). commit.timestamp = atol(entries[3].c_str()); data/gource-0.51/src/formats/hg.cpp:90: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 cmd_buff[2048]; data/gource-0.51/src/formats/hg.cpp:122:28: [2] (integer) atol: 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). time_t timestamp = atol(entries[0].c_str()); data/gource-0.51/src/formats/svn.cpp:69: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 cwd_buff[1024]; data/gource-0.51/src/formats/svn.cpp:97: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 cmd_buff[2048]; data/gource-0.51/src/formats/svn.cpp:230:25: [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). time_str.tm_year = atoi(entries[0].c_str()) - 1900; data/gource-0.51/src/formats/svn.cpp:231:25: [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). time_str.tm_mon = atoi(entries[1].c_str()) - 1; data/gource-0.51/src/formats/svn.cpp:232:25: [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). time_str.tm_mday = atoi(entries[2].c_str()); data/gource-0.51/src/formats/svn.cpp:233:25: [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). time_str.tm_hour = atoi(entries[3].c_str()); data/gource-0.51/src/formats/svn.cpp:234:25: [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). time_str.tm_min = atoi(entries[4].c_str()); data/gource-0.51/src/formats/svn.cpp:235:25: [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). time_str.tm_sec = atoi(entries[5].c_str()); data/gource-0.51/src/gource.cpp:175: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). fh = fopen(output_file.c_str(), "w"); data/gource-0.51/src/gource.cpp:281: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 datestr[256]; data/gource-0.51/src/gource.cpp:1084:31: [2] (integer) atol: 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). time_t timestamp = atol(matches[0].c_str()); data/gource-0.51/src/gource.cpp:1433: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 datestr[256]; data/gource-0.51/src/gource.cpp:2191: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 msgbuff[1024]; data/gource-0.51/src/gource.cpp:2206: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 pngname[256]; data/gource-0.51/src/gource_settings.cpp:826:17: [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 data[4096]; data/gource-0.51/src/gource_settings.cpp:1203:34: [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). file_idle_time = (float) atoi(file_idle_str.c_str()); data/gource-0.51/src/gource_settings.cpp:1241:13: [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 datestr[256]; data/gource-0.51/src/gource_settings.cpp:1267:13: [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 datestr[256]; data/gource-0.51/src/main.cpp:165: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 errormsg[1024]; data/gource-0.51/src/main.cpp:182:13: [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 errormsg[1024]; data/gource-0.51/src/main.cpp:201: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 errormsg[1024]; data/gource-0.51/src/tinyxml/tinystr.cpp:43: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(tmp.start(), data(), length()); data/gource-0.51/src/tinyxml/tinystr.cpp:56: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(tmp.start(), str, len); data/gource-0.51/src/tinyxml/tinystr.h:74: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(start(), copy.data(), length()); data/gource-0.51/src/tinyxml/tinystr.h:81: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(start(), copy, length()); data/gource-0.51/src/tinyxml/tinystr.h:88: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(start(), str, len); data/gource-0.51/src/tinyxml/tinystr.h:214:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[1]; data/gource-0.51/src/tinyxml/tinyxml.cpp:48: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). return fopen( filename, mode ); data/gource-0.51/src/tinyxml/tinyxml.cpp:112:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[ 32 ]; data/gource-0.51/src/tinyxml/tinyxml.cpp:117: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( buf, "&#x%02X;", (unsigned) ( c & 0xff ) ); data/gource-0.51/src/tinyxml/tinyxml.cpp:1252: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 buf [64]; data/gource-0.51/src/tinyxml/tinyxml.cpp:1256: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", _value); data/gource-0.51/src/tinyxml/tinyxml.cpp:1263: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 buf [256]; data/gource-0.51/src/tinyxml/tinyxml.cpp:1267: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, "%g", _value); data/gource-0.51/src/tinyxml/tinyxml.cpp:1274:9: [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 (value.c_str ()); data/gource-0.51/src/tinyxml/tinyxmlparser.cpp:591:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cArr[4] = { 0, 0, 0, 0 }; data/gource-0.51/src/tinyxml/tinyxmlparser.cpp:625: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 cArr[4] = { 0, 0, 0, 0 }; data/gource-0.51/src/core/sdlapp.cpp:128:9: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getchar(); data/gource-0.51/src/core/sdlapp.cpp:149:9: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getchar(); data/gource-0.51/src/core/seeklog.cpp:131:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(!file->read(filebuffer, file_size)) { data/gource-0.51/src/formats/git.cpp:65:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). in.read(version_str, sizeof(version_str)); data/gource-0.51/src/formats/git.cpp:185:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). in.read(firstBytes, 8); data/gource-0.51/src/gource_settings.cpp:197:9: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getchar(); data/gource-0.51/src/tinyxml/tinystr.cpp:93:70: [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). TiXmlString::size_type b_len = static_cast<TiXmlString::size_type>( strlen(b) ); data/gource-0.51/src/tinyxml/tinystr.cpp:103:70: [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). TiXmlString::size_type a_len = static_cast<TiXmlString::size_type>( strlen(a) ); data/gource-0.51/src/tinyxml/tinystr.h:80: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). init( static_cast<size_type>( strlen(copy) )); data/gource-0.51/src/tinyxml/tinystr.h:99: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). return assign( copy, (size_type)strlen(copy)); data/gource-0.51/src/tinyxml/tinystr.h:111:49: [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 append(suffix, static_cast<size_type>( strlen(suffix) )); data/gource-0.51/src/tinyxml/tinyxml.cpp:122: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). outString->append( buf, (int)strlen( buf ) ); data/gource-0.51/src/tinyxml/tinyxmlparser.cpp:519: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). assert( strlen( entity[i].str ) == entity[i].strLength ); data/gource-0.51/src/tinyxml/tinyxmlparser.cpp:635: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). p += strlen( endTag ); data/gource-0.51/src/tinyxml/tinyxmlparser.cpp:1358: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). p += strlen( startTag ); data/gource-0.51/src/tinyxml/tinyxmlparser.cpp:1386: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). p += strlen( endTag ); data/gource-0.51/src/tinyxml/tinyxmlparser.cpp:1521: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). p += strlen( startTag ); ANALYSIS SUMMARY: Hits = 190 Lines analyzed = 30393 in approximately 0.79 seconds (38239 lines/second) Physical Source Lines of Code (SLOC) = 18942 Hits@level = [0] 188 [1] 17 [2] 147 [3] 4 [4] 22 [5] 0 Hits@level+ = [0+] 378 [1+] 190 [2+] 173 [3+] 26 [4+] 22 [5+] 0 Hits/KSLOC@level+ = [0+] 19.9557 [1+] 10.0306 [2+] 9.13314 [3+] 1.37261 [4+] 1.16144 [5+] 0 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.