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/xdelta3-3.0.11-dfsg/testing/sizes.h Examining data/xdelta3-3.0.11-dfsg/testing/regtest_c.c Examining data/xdelta3-3.0.11-dfsg/testing/segment.h Examining data/xdelta3-3.0.11-dfsg/testing/random.h Examining data/xdelta3-3.0.11-dfsg/testing/modify.h Examining data/xdelta3-3.0.11-dfsg/testing/regtest.cc Examining data/xdelta3-3.0.11-dfsg/testing/file.h Examining data/xdelta3-3.0.11-dfsg/testing/test.h Examining data/xdelta3-3.0.11-dfsg/testing/delta.h Examining data/xdelta3-3.0.11-dfsg/testing/cmp.h Examining data/xdelta3-3.0.11-dfsg/xdelta3-test.h Examining data/xdelta3-3.0.11-dfsg/xdelta3-internal.h Examining data/xdelta3-3.0.11-dfsg/xdelta3-cfgs.h Examining data/xdelta3-3.0.11-dfsg/xdelta3.h Examining data/xdelta3-3.0.11-dfsg/xdelta3-blkcache.h Examining data/xdelta3-3.0.11-dfsg/xdelta3.c Examining data/xdelta3-3.0.11-dfsg/xdelta3-djw.h Examining data/xdelta3-3.0.11-dfsg/xdelta3-list.h Examining data/xdelta3-3.0.11-dfsg/xdelta3-fgk.h Examining data/xdelta3-3.0.11-dfsg/xdelta3-lzma.h Examining data/xdelta3-3.0.11-dfsg/examples/encode_decode_test.c Examining data/xdelta3-3.0.11-dfsg/examples/speed_test.c Examining data/xdelta3-3.0.11-dfsg/examples/compare_test.c Examining data/xdelta3-3.0.11-dfsg/examples/test.h Examining data/xdelta3-3.0.11-dfsg/examples/checksum_test.cc Examining data/xdelta3-3.0.11-dfsg/examples/small_page_test.c Examining data/xdelta3-3.0.11-dfsg/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/Xd3iOSViewController.h Examining data/xdelta3-3.0.11-dfsg/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/Xd3iOSAppDelegate.h Examining data/xdelta3-3.0.11-dfsg/xdelta3-decode.h Examining data/xdelta3-3.0.11-dfsg/xdelta3-merge.h Examining data/xdelta3-3.0.11-dfsg/xdelta3-hash.h Examining data/xdelta3-3.0.11-dfsg/xdelta3-second.h Examining data/xdelta3-3.0.11-dfsg/xdelta3-main.h FINAL RESULTS: data/xdelta3-3.0.11-dfsg/xdelta3-internal.h:131:23: [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 snprintf_func _snprintf data/xdelta3-3.0.11-dfsg/xdelta3-internal.h:133:24: [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. #define vsnprintf_func vsnprintf data/xdelta3-3.0.11-dfsg/xdelta3-internal.h:134:23: [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 snprintf_func snprintf data/xdelta3-3.0.11-dfsg/xdelta3-main.h:2296:4: [4] (shell) execlp: 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. execlp (decomp->decomp_cmdname, decomp->decomp_cmdname, data/xdelta3-3.0.11-dfsg/xdelta3-main.h:2553:4: [4] (shell) execlp: 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. execlp (recomp->recomp_cmdname, recomp->recomp_cmdname, data/xdelta3-3.0.11-dfsg/xdelta3-main.h:2763: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(file->filename_copy + dlen + 1, parsed[0]); data/xdelta3-3.0.11-dfsg/xdelta3-main.h:3506: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(*env_free, v); data/xdelta3-3.0.11-dfsg/xdelta3-test.h:158: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. if ((ret = system (buf)) != 0) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:177: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. ret = system (buf); data/xdelta3-3.0.11-dfsg/xdelta3-test.h:468: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. if ((ret = system (buf)) != 0) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1011:3: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system ("rm -rf test_text.*"); data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1759:18: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if ((ret = system (ecmd)) != 0) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1766:18: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if ((ret = system (dcmd)) != 0) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1834: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. if ((ret = system (vcmd)) != 0) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1902: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. if ((ret = system (ecmd)) != 0) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1919: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. if ((ret = system (recmd)) != 0) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1999: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. if ((ret = system (dcmd)) != 0) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2070: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. if ((ret = system (ecmd)) != 0) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2126: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. if ((ret = system (buf)) != 0) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2176:18: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if ((ret = system (buf)) != 0) data/xdelta3-3.0.11-dfsg/xdelta3.h:288:14: [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 DP fprintf data/xdelta3-3.0.11-dfsg/xdelta3-main.h:3496:17: [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 *p, *v = getenv("XDELTA"); data/xdelta3-3.0.11-dfsg/examples/encode_decode_test.c:171:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). InFile = fopen(input, "rb"); data/xdelta3-3.0.11-dfsg/examples/encode_decode_test.c:172:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). SrcFile = fopen(source, "rb"); data/xdelta3-3.0.11-dfsg/examples/encode_decode_test.c:173:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). OutFile = fopen(output, "wb"); data/xdelta3-3.0.11-dfsg/examples/encode_decode_test.c:188:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). InFile = fopen(output, "rb"); data/xdelta3-3.0.11-dfsg/examples/encode_decode_test.c:189:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). SrcFile = fopen(source, "rb"); data/xdelta3-3.0.11-dfsg/examples/encode_decode_test.c:190:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). OutFile = fopen(decoded, "wb"); data/xdelta3-3.0.11-dfsg/examples/speed_test.c:33:11: [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). level = atoi(argv[1]); data/xdelta3-3.0.11-dfsg/examples/speed_test.c:34: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). repeat = atoi(argv[2]); data/xdelta3-3.0.11-dfsg/testing/file.h:52: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(data_, tmp, size_); data/xdelta3-3.0.11-dfsg/testing/file.h:56: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(data_ + size_, data, size); data/xdelta3-3.0.11-dfsg/testing/file.h:94: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(data_, t, size); data/xdelta3-3.0.11-dfsg/testing/file.h:315: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[64]; data/xdelta3-3.0.11-dfsg/testing/regtest.cc:233: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 bbuf[16]; data/xdelta3-3.0.11-dfsg/testing/regtest.cc:372:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[64]; data/xdelta3-3.0.11-dfsg/testing/segment.h:45: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(data, data_ + seg_offset, size); data/xdelta3-3.0.11-dfsg/testing/segment.h:63: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[10]; data/xdelta3-3.0.11-dfsg/testing/segment.h:64: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(buf, "%02x ", data_[i]); data/xdelta3-3.0.11-dfsg/testing/segment.h:68:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/xdelta3-3.0.11-dfsg/testing/segment.h:69: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, "size=%ld,seed=%ud,skip=%ld", size_, seed_, seed_offset_); data/xdelta3-3.0.11-dfsg/xdelta3-decode.h:64: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 (buf + *pos, stream->next_in, (size_t) take); data/xdelta3-3.0.11-dfsg/xdelta3-decode.h:239:4: [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 (section->copied1 + section->pos, data/xdelta3-3.0.11-dfsg/xdelta3-decode.h:448: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 (stream->next_out + stream->avail_out, data/xdelta3-3.0.11-dfsg/xdelta3-decode.h:590: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 (dst, src, take); data/xdelta3-3.0.11-dfsg/xdelta3-djw.h:653: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 (prefix->symbol, clen[0], ALPHABET_SIZE); data/xdelta3-3.0.11-dfsg/xdelta3-hash.h:71:36: [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 UNALIGNED_READ32(dest,src) memcpy((dest), (src), 4); data/xdelta3-3.0.11-dfsg/xdelta3-internal.h:141:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[48]; data/xdelta3-3.0.11-dfsg/xdelta3-main.h:318:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1000]; data/xdelta3-3.0.11-dfsg/xdelta3-main.h:516: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. static char err_buf[256]; data/xdelta3-3.0.11-dfsg/xdelta3-main.h:862:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). xfile->file = fopen (name, XOPEN_STDIO); data/xdelta3-3.0.11-dfsg/xdelta3-main.h:868:14: [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 ((ret = open (name, XOPEN_POSIX, XOPEN_MODE)) < 0) data/xdelta3-3.0.11-dfsg/xdelta3-main.h:1559: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 (output->base, data/xdelta3-3.0.11-dfsg/xdelta3-main.h:1941:8: [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 (main_bdata + window_pos, data/xdelta3-3.0.11-dfsg/xdelta3-main.h:2505: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 (input_buf, check_buf, check_nread); data/xdelta3-3.0.11-dfsg/xdelta3-main.h:2806:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *parsed[4]; data/xdelta3-3.0.11-dfsg/xdelta3-merge.h:58: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, a, sizeof (xd3_whole_state)); data/xdelta3-3.0.11-dfsg/xdelta3-merge.h:59: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 (a, b, sizeof (xd3_whole_state)); data/xdelta3-3.0.11-dfsg/xdelta3-merge.h:60: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 (b, &tmp, sizeof (xd3_whole_state)); data/xdelta3-3.0.11-dfsg/xdelta3-merge.h:93: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 (new_buf, *alloc_ptr, cur_size); data/xdelta3-3.0.11-dfsg/xdelta3-merge.h:197: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 (stream->whole_target.adds + stream->whole_target.addslen, data/xdelta3-3.0.11-dfsg/xdelta3-merge.h:337: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(stream->whole_target.adds + stream->whole_target.addslen, data/xdelta3-3.0.11-dfsg/xdelta3-merge.h:360: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 (oinst, iinst, sizeof (*oinst)); data/xdelta3-3.0.11-dfsg/xdelta3-merge.h:482:4: [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(stream->whole_target.adds + stream->whole_target.addslen, data/xdelta3-3.0.11-dfsg/xdelta3-test.h:134: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 TEST_TARGET_FILE[TESTFILESIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:135: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 TEST_SOURCE_FILE[TESTFILESIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:136: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 TEST_DELTA_FILE[TESTFILESIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:137: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 TEST_RECON_FILE[TESTFILESIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:138: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 TEST_RECON2_FILE[TESTFILESIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:139: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 TEST_COPY_FILE[TESTFILESIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:140: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 TEST_NOPERM_FILE[TESTFILESIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:221:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[64]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:299:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((tf = fopen (TEST_TARGET_FILE, "w")) == NULL || data/xdelta3-3.0.11-dfsg/xdelta3-test.h:300:32: [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). (ss_out != NULL && (sf = fopen (TEST_SOURCE_FILE, "w")) == NULL)) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:410:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((orig = fopen (tgt, "r")) == NULL) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:416:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((recons = fopen (rec, "r")) == NULL) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:463:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:782: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 (big_buf + offset, outp->base, outp->next); data/xdelta3-3.0.11-dfsg/xdelta3-test.h:902: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 decoded[sizeof (test_text)]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:950: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 (decoded, stream->next_out, stream->avail_out); data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1013: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[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1016: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). f = fopen (buf, "w"); data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1022: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[TESTBUFSIZE]; \ data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1025: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). f = fopen (buf, "w"); \ data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1442:8: [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 (dec_input + p_off, p->base, p->next); data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1451:8: [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 (dec_correct + p_off, p->base, p->next); data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1740: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 ecmd[TESTBUFSIZE], dcmd[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1829: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 vcmd[TESTBUFSIZE], gcmd[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:1880: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 ecmd[TESTBUFSIZE], recmd[TESTBUFSIZE], dcmd[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2054: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 ecmd[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2106: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 decomp_buf[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2163:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2212:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2305:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2337:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2371:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2410:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2411: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 bogus[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2556: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 (del + delpos, stream->next_out, stream->avail_out); data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2678: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 rbuf[TESTBUFSIZE]; data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2873: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(ibuf, test_text, size); data/xdelta3-3.0.11-dfsg/xdelta3.c:1247: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 (output->base + output->next, base, (size_t) take); data/xdelta3-3.0.11-dfsg/xdelta3.c:2916: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 (stream->buf_in, stream->buf_leftover, stream->buf_leftavail); data/xdelta3-3.0.11-dfsg/xdelta3.c:2926: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 (stream->buf_in + stream->buf_avail, stream->next_in, take); data/xdelta3-3.0.11-dfsg/xdelta3.c:3398: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 (output + *output_size, stream->next_out, stream->avail_out); data/xdelta3-3.0.11-dfsg/xdelta3-main.h:528:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (err_buf[0] != 0 && err_buf[strlen(err_buf) - 1] == '\n') data/xdelta3-3.0.11-dfsg/xdelta3-main.h:530: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). err_buf[strlen(err_buf) - 1] = 0; data/xdelta3-3.0.11-dfsg/xdelta3-main.h:1049:66: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = xd3_posix_io (ifile->file, buf, size, (xd3_posix_func*) &read, nread); data/xdelta3-3.0.11-dfsg/xdelta3-main.h:1194: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 (option_secondary) > 3 && data/xdelta3-3.0.11-dfsg/xdelta3-main.h:1615: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). (usize_t) strlen ((char*) option_appheader)); data/xdelta3-3.0.11-dfsg/xdelta3-main.h:1853: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). (usize_t) strlen ((char*) option_appheader)); data/xdelta3-3.0.11-dfsg/xdelta3-main.h:2695:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = (usize_t) strlen (iname) + (usize_t) strlen (icomp) + 2; data/xdelta3-3.0.11-dfsg/xdelta3-main.h:2695: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). len = (usize_t) strlen (iname) + (usize_t) strlen (icomp) + 2; data/xdelta3-3.0.11-dfsg/xdelta3-main.h:2701: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). len += (usize_t) strlen (sname) + (usize_t) strlen (scomp) + 2; data/xdelta3-3.0.11-dfsg/xdelta3-main.h:2701:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len += (usize_t) strlen (sname) + (usize_t) strlen (scomp) + 2; data/xdelta3-3.0.11-dfsg/xdelta3-main.h:2725: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). (usize_t) strlen ((char*)appheader_used)); data/xdelta3-3.0.11-dfsg/xdelta3-main.h:2759: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). (char*) main_malloc(dlen + 2 + (usize_t) strlen(file->filename)); data/xdelta3-3.0.11-dfsg/xdelta3-main.h:2761:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(file->filename_copy, other->filename, dlen); data/xdelta3-3.0.11-dfsg/xdelta3-main.h:3505: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). (*env_free) = (char*) main_malloc((usize_t) strlen(v) + 1); data/xdelta3-3.0.11-dfsg/xdelta3-test.h:884: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). (usize_t) strlen ((char*) test_apphead)); data/xdelta3-3.0.11-dfsg/xdelta3-test.h:956:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (apphead_size != strlen ((char*) test_apphead) || data/xdelta3-3.0.11-dfsg/xdelta3-test.h:957:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcmp (apphead, test_apphead, strlen ((char*) test_apphead)) != 0) data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2684:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). usize_t len = (usize_t) strlen (test->input); data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2719: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). rptr += strlen (rptr); data/xdelta3-3.0.11-dfsg/xdelta3-test.h:2725: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). rptr += strlen (rptr); ANALYSIS SUMMARY: Hits = 125 Lines analyzed = 23714 in approximately 0.54 seconds (44036 lines/second) Physical Source Lines of Code (SLOC) = 17023 Hits@level = [0] 44 [1] 20 [2] 83 [3] 1 [4] 21 [5] 0 Hits@level+ = [0+] 169 [1+] 125 [2+] 105 [3+] 22 [4+] 21 [5+] 0 Hits/KSLOC@level+ = [0+] 9.92774 [1+] 7.34301 [2+] 6.16813 [3+] 1.29237 [4+] 1.23363 [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.