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/scrcpy-1.14/app/src/android/input.h
Examining data/scrcpy-1.14/app/src/android/keycodes.h
Examining data/scrcpy-1.14/app/src/cli.c
Examining data/scrcpy-1.14/app/src/cli.h
Examining data/scrcpy-1.14/app/src/command.c
Examining data/scrcpy-1.14/app/src/command.h
Examining data/scrcpy-1.14/app/src/common.h
Examining data/scrcpy-1.14/app/src/compat.h
Examining data/scrcpy-1.14/app/src/control_msg.c
Examining data/scrcpy-1.14/app/src/control_msg.h
Examining data/scrcpy-1.14/app/src/controller.c
Examining data/scrcpy-1.14/app/src/controller.h
Examining data/scrcpy-1.14/app/src/decoder.c
Examining data/scrcpy-1.14/app/src/decoder.h
Examining data/scrcpy-1.14/app/src/device.c
Examining data/scrcpy-1.14/app/src/device.h
Examining data/scrcpy-1.14/app/src/device_msg.c
Examining data/scrcpy-1.14/app/src/device_msg.h
Examining data/scrcpy-1.14/app/src/event_converter.c
Examining data/scrcpy-1.14/app/src/event_converter.h
Examining data/scrcpy-1.14/app/src/events.h
Examining data/scrcpy-1.14/app/src/file_handler.c
Examining data/scrcpy-1.14/app/src/file_handler.h
Examining data/scrcpy-1.14/app/src/fps_counter.c
Examining data/scrcpy-1.14/app/src/fps_counter.h
Examining data/scrcpy-1.14/app/src/input_manager.c
Examining data/scrcpy-1.14/app/src/input_manager.h
Examining data/scrcpy-1.14/app/src/main.c
Examining data/scrcpy-1.14/app/src/opengl.c
Examining data/scrcpy-1.14/app/src/opengl.h
Examining data/scrcpy-1.14/app/src/receiver.c
Examining data/scrcpy-1.14/app/src/receiver.h
Examining data/scrcpy-1.14/app/src/recorder.c
Examining data/scrcpy-1.14/app/src/recorder.h
Examining data/scrcpy-1.14/app/src/scrcpy.c
Examining data/scrcpy-1.14/app/src/scrcpy.h
Examining data/scrcpy-1.14/app/src/screen.c
Examining data/scrcpy-1.14/app/src/screen.h
Examining data/scrcpy-1.14/app/src/server.c
Examining data/scrcpy-1.14/app/src/server.h
Examining data/scrcpy-1.14/app/src/stream.c
Examining data/scrcpy-1.14/app/src/stream.h
Examining data/scrcpy-1.14/app/src/sys/unix/command.c
Examining data/scrcpy-1.14/app/src/sys/win/command.c
Examining data/scrcpy-1.14/app/src/tiny_xpm.c
Examining data/scrcpy-1.14/app/src/tiny_xpm.h
Examining data/scrcpy-1.14/app/src/util/buffer_util.h
Examining data/scrcpy-1.14/app/src/util/cbuf.h
Examining data/scrcpy-1.14/app/src/util/lock.h
Examining data/scrcpy-1.14/app/src/util/log.h
Examining data/scrcpy-1.14/app/src/util/net.c
Examining data/scrcpy-1.14/app/src/util/net.h
Examining data/scrcpy-1.14/app/src/util/queue.h
Examining data/scrcpy-1.14/app/src/util/str_util.c
Examining data/scrcpy-1.14/app/src/util/str_util.h
Examining data/scrcpy-1.14/app/src/video_buffer.c
Examining data/scrcpy-1.14/app/src/video_buffer.h
Examining data/scrcpy-1.14/app/tests/test_buffer_util.c
Examining data/scrcpy-1.14/app/tests/test_cbuf.c
Examining data/scrcpy-1.14/app/tests/test_cli.c
Examining data/scrcpy-1.14/app/tests/test_control_msg_serialize.c
Examining data/scrcpy-1.14/app/tests/test_device_msg_deserialize.c
Examining data/scrcpy-1.14/app/tests/test_queue.c
Examining data/scrcpy-1.14/app/tests/test_strutil.c

FINAL RESULTS:

data/scrcpy-1.14/app/src/sys/unix/command.c:155:19:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    ssize_t len = readlink("/proc/self/exe", buf, PATH_MAX);
data/scrcpy-1.14/app/src/command.c:134:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(local, "tcp:%" PRIu16, local_port);
data/scrcpy-1.14/app/src/command.c:143:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(local, "tcp:%" PRIu16, local_port);
data/scrcpy-1.14/app/src/command.c:153:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(local, "tcp:%" PRIu16, local_port);
data/scrcpy-1.14/app/src/device.c:18:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(device_name, (char *) buf);
data/scrcpy-1.14/app/src/scrcpy.c:287:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(local_fmt + 9, fmt);
data/scrcpy-1.14/app/src/server.c:261:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(max_size_string, "%"PRIu16, params->max_size);
data/scrcpy-1.14/app/src/server.c:262:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(bit_rate_string, "%"PRIu32, params->bit_rate);
data/scrcpy-1.14/app/src/server.c:263:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(max_fps_string, "%"PRIu16, params->max_fps);
data/scrcpy-1.14/app/src/server.c:264:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(lock_video_orientation_string, "%"PRIi8, params->lock_video_orientation);
data/scrcpy-1.14/app/src/server.c:265:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(display_id_string, "%"PRIu16, params->display_id);
data/scrcpy-1.14/app/src/sys/unix/command.c:94:13:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
            execvp(argv[0], (char *const *)argv);
data/scrcpy-1.14/app/src/cli.c:578:17:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((c = getopt_long(argc, argv, "b:c:fF:hm:nNp:r:s:StTvV:w",
data/scrcpy-1.14/app/src/command.c:18:23:  [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.
        adb_command = getenv("ADB");
data/scrcpy-1.14/app/src/server.c:29:35:  [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.
    const char *server_path_env = getenv("SCRCPY_SERVER_PATH");
data/scrcpy-1.14/app/src/sys/unix/command.c:28:18:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    char *path = getenv("PATH");
data/scrcpy-1.14/app/src/command.c:37:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(&buf[idx], "...", 3);
data/scrcpy-1.14/app/src/command.c:48:9:  [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[idx], arg, len);
data/scrcpy-1.14/app/src/command.c:86: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[512];
data/scrcpy-1.14/app/src/command.c:107: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 *cmd[len + 4];
data/scrcpy-1.14/app/src/command.c:119: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(&cmd[i], adb_cmd, len * sizeof(const char *));
data/scrcpy-1.14/app/src/command.c:132: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 local[4 + 5 + 1]; // tcp:PORT
data/scrcpy-1.14/app/src/command.c:133: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 remote[108 + 14 + 1]; // localabstract:NAME
data/scrcpy-1.14/app/src/command.c:142: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 local[4 + 5 + 1]; // tcp:PORT
data/scrcpy-1.14/app/src/command.c:151: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 local[4 + 5 + 1]; // tcp:PORT
data/scrcpy-1.14/app/src/command.c:152: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 remote[108 + 14 + 1]; // localabstract:NAME
data/scrcpy-1.14/app/src/command.c:161: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 remote[108 + 14 + 1]; // localabstract:NAME
data/scrcpy-1.14/app/src/control_msg.c:24: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(&buf[2], utf8, len);
data/scrcpy-1.14/app/src/controller.c:63:14:  [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.
    unsigned char serialized_msg[CONTROL_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/src/device.c:8:14:  [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.
    unsigned char buf[DEVICE_NAME_FIELD_LENGTH + 4];
data/scrcpy-1.14/app/src/device_msg.c:30:17:  [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(text, &buf[3], clipboard_len);
data/scrcpy-1.14/app/src/receiver.c:63:14:  [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.
    unsigned char buf[DEVICE_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/src/recorder.c:209: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(extradata, packet->data, packet->size);
data/scrcpy-1.14/app/src/scrcpy.c:286:5:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
    strcpy(local_fmt, "[FFmpeg] ");
data/scrcpy-1.14/app/src/scrcpy.c:332: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 device_name[DEVICE_NAME_FIELD_LENGTH];
data/scrcpy-1.14/app/src/server.c:78: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(server_path, dir, dirlen);
data/scrcpy-1.14/app/src/server.c:80: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(&server_path[dirlen + 1], SERVER_FILENAME, sizeof(SERVER_FILENAME));
data/scrcpy-1.14/app/src/server.c:256: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 max_size_string[6];
data/scrcpy-1.14/app/src/server.c:257: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 bit_rate_string[11];
data/scrcpy-1.14/app/src/server.c:258: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 max_fps_string[6];
data/scrcpy-1.14/app/src/server.c:259: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 lock_video_orientation_string[5];
data/scrcpy-1.14/app/src/server.c:260: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 display_id_string[6];
data/scrcpy-1.14/app/src/stream.c:150:9:  [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->pending.data + offset, packet->data, packet->size);
data/scrcpy-1.14/app/src/sys/unix/command.c:44:9:  [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(fullpath, dir, dir_len);
data/scrcpy-1.14/app/src/sys/unix/command.c:46:9:  [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(fullpath + dir_len + 1, file, file_len + 1);
data/scrcpy-1.14/app/src/sys/unix/command.c:154: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[PATH_MAX + 1]; // +1 for the null byte
data/scrcpy-1.14/app/src/sys/win/command.c:30: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[256];
data/scrcpy-1.14/app/src/util/str_util.c:58: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(&quoted[1], src, len);
data/scrcpy-1.14/app/src/util/str_util.c:167:15:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
    int len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0);
data/scrcpy-1.14/app/src/util/str_util.c:177:5:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
    MultiByteToWideChar(CP_UTF8, 0, utf8, -1, wide, len);
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:16:14:  [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.
    unsigned char buf[CONTROL_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:37:14:  [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.
    unsigned char buf[CONTROL_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:52: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 text[CONTROL_MSG_INJECT_TEXT_MAX_LENGTH + 1];
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:57:14:  [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.
    unsigned char buf[CONTROL_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:61:14:  [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.
    unsigned char expected[3 + CONTROL_MSG_INJECT_TEXT_MAX_LENGTH];
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:91:14:  [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.
    unsigned char buf[CONTROL_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:126:14:  [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.
    unsigned char buf[CONTROL_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:145:14:  [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.
    unsigned char buf[CONTROL_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:160:14:  [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.
    unsigned char buf[CONTROL_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:175:14:  [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.
    unsigned char buf[CONTROL_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:190:14:  [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.
    unsigned char buf[CONTROL_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:209:14:  [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.
    unsigned char buf[CONTROL_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:230:14:  [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.
    unsigned char buf[CONTROL_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/tests/test_control_msg_serialize.c:246:14:  [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.
    unsigned char buf[CONTROL_MSG_SERIALIZED_MAX_SIZE];
data/scrcpy-1.14/app/tests/test_strutil.c:268: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[32];
data/scrcpy-1.14/app/tests/test_strutil.c:270: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, "%ldk", LONG_MAX / 2000);
data/scrcpy-1.14/app/tests/test_strutil.c:275: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, "%ldm", LONG_MAX / 2000);
data/scrcpy-1.14/app/tests/test_strutil.c:279: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, "%ldk", LONG_MIN / 2000);
data/scrcpy-1.14/app/tests/test_strutil.c:284: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, "%ldm", LONG_MIN / 2000);
data/scrcpy-1.14/app/src/cli.c:494: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).
    size_t len = strlen(filename);
data/scrcpy-1.14/app/src/command.c:32:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        size_t len = strlen(arg);
data/scrcpy-1.14/app/src/main.c:103:9:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        getchar();
data/scrcpy-1.14/app/src/scrcpy.c:280:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    char *local_fmt = SDL_malloc(strlen(fmt) + 10);
data/scrcpy-1.14/app/src/server.c:66:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    size_t dirlen = strlen(dir);
data/scrcpy-1.14/app/src/sys/unix/command.c:36:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    size_t file_len = strlen(file);
data/scrcpy-1.14/app/src/sys/unix/command.c:40:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        size_t dir_len = strlen(dir);
data/scrcpy-1.14/app/src/sys/unix/command.c:85:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (read(fd[0], &ret, sizeof(ret)) == -1) {
data/scrcpy-1.14/app/src/util/str_util.c:53: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).
    size_t len = strlen(src);
data/scrcpy-1.14/app/src/util/str_util.c:149: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).
    size_t len = strlen(utf8);
data/scrcpy-1.14/app/tests/test_strutil.c:144: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(s) == 7); // É and Ô are 2 bytes-wide

ANALYSIS SUMMARY:

Hits = 80
Lines analyzed = 10037 in approximately 0.25 seconds (39592 lines/second)
Physical Source Lines of Code (SLOC) = 7229
Hits@level = [0]  15 [1]  11 [2]  53 [3]   4 [4]  11 [5]   1
Hits@level+ = [0+]  95 [1+]  80 [2+]  69 [3+]  16 [4+]  12 [5+]   1
Hits/KSLOC@level+ = [0+] 13.1415 [1+] 11.0665 [2+] 9.54489 [3+] 2.21331 [4+] 1.65998 [5+] 0.138332
Dot directories skipped = 2 (--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.