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/libappimage-0.1.9+dfsg/include/appimage/appimage.h
Examining data/libappimage-0.1.9+dfsg/include/appimage/appimage_shared.h
Examining data/libappimage-0.1.9+dfsg/src/libappimage/appimage_handler.c
Examining data/libappimage-0.1.9+dfsg/src/libappimage/appimage_handler.h
Examining data/libappimage-0.1.9+dfsg/src/libappimage/desktop_file_integration_private.h
Examining data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c
Examining data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.h
Examining data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c
Examining data/libappimage-0.1.9+dfsg/src/libappimage/libappimage_private.h
Examining data/libappimage-0.1.9+dfsg/src/libappimage/type1.c
Examining data/libappimage-0.1.9+dfsg/src/libappimage/type1.h
Examining data/libappimage-0.1.9+dfsg/src/libappimage/type2.c
Examining data/libappimage-0.1.9+dfsg/src/libappimage/type2.h
Examining data/libappimage-0.1.9+dfsg/src/libappimage_hashlib/include/hashlib.h
Examining data/libappimage-0.1.9+dfsg/src/libappimage_hashlib/include/md5.h
Examining data/libappimage-0.1.9+dfsg/src/libappimage_hashlib/md5.c
Examining data/libappimage-0.1.9+dfsg/src/libappimage_shared/digest.c
Examining data/libappimage-0.1.9+dfsg/src/libappimage_shared/elf.c
Examining data/libappimage-0.1.9+dfsg/src/libappimage_shared/hexlify.c
Examining data/libappimage-0.1.9+dfsg/src/libappimage_shared/light_byteswap.h
Examining data/libappimage-0.1.9+dfsg/src/libappimage_shared/light_elf.h
Examining data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.c
Examining data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.h
Examining data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c
Examining data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.h
Examining data/libappimage-0.1.9+dfsg/tests/file_management_utils.hpp
Examining data/libappimage-0.1.9+dfsg/tests/fixtures.h
Examining data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp
Examining data/libappimage-0.1.9+dfsg/tests/test_desktop_integration.cpp
Examining data/libappimage-0.1.9+dfsg/tests/test_getsection.cpp
Examining data/libappimage-0.1.9+dfsg/tests/test_libappimage.cpp
Examining data/libappimage-0.1.9+dfsg/tests/test_shared.cpp

FINAL RESULTS:

data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:359:25:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
                        chmod (dest, 0644);
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:1062:5:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    chmod(destination, 0755);
data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.h:159:8:  [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.
	int (*readlink) (const char *, char *, size_t);
data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.h:168:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	int (*chmod) (const char *, mode_t);
data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.h:169:8:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
	int (*chown) (const char *, uid_t, gid_t);
data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.h:215:10:  [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.
  void (*readlink) (fuse_req_t req, fuse_ino_t ino);
data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c:187:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(new_exec_value, appimage_path);
data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c:191:13:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
            strcat(new_exec_value, field_value);
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:648:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(new_exec_value, appimage_path);
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:652:13:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
            strcat(new_exec_value, field_value);
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:1596:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(glob_pattern, "%s/applications/appimagekit_%s-*.desktop", data_home, md5);
data/libappimage-0.1.9+dfsg/src/libappimage_shared/hexlify.c:14:9:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(hexlified, buffer);
data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.h:189:8:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	int (*access) (const char *, int);
data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.h:238:10:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  void (*access) (fuse_req_t req, fuse_ino_t ino, int mask);
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:18:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(config_home, home);
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:19:9:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(config_home, suffix);
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:38:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(data_home, home);
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:39:9:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(data_home, suffix);
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:58:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(cache_home, home);
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:59:9:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(cache_home, suffix);
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:49: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(expectedValue, getenv("HOME"));
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:91: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(expectedValue, getenv("HOME"));
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:133: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(expectedValue, getenv("HOME"));
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:91:26:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    if ((absolute_path = realpath(path, NULL)) == NULL)
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:6:19:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    return strdup(getenv("HOME"));
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:10:25:  [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* config_home = getenv("XDG_CONFIG_HOME");
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:30: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.
    char* data_home = getenv("XDG_DATA_HOME");
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:50:24:  [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* cache_home = getenv("XDG_CACHE_HOME");
data/libappimage-0.1.9+dfsg/tests/fixtures.h:42:19:  [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.
        oldHome = getenv("HOME");
data/libappimage-0.1.9+dfsg/tests/fixtures.h:43:26:  [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.
        oldXdgDataHome = getenv("XDG_DATA_HOME");
data/libappimage-0.1.9+dfsg/tests/fixtures.h:44: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.
        oldXdgConfigHome = getenv("XDG_CONFIG_HOME");
data/libappimage-0.1.9+dfsg/tests/fixtures.h:56:19:  [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.
        EXPECT_EQ(getenv("HOME"), tempHome);
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:20:40:  [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.
    EXPECT_PRED2(compareStrings, home, getenv("HOME"));
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:25:29:  [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* oldValue = strdup(getenv("HOME"));
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:29:48:  [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.
    EXPECT_PRED2(compareStrings, currentValue, getenv("HOME"));
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:41:21:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if ((oldValue = getenv("XDG_DATA_HOME")) != NULL) {
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:49:27:  [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.
    strcpy(expectedValue, getenv("HOME"));
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:64:22:  [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* oldValue = getenv("XDG_DATA_HOME");
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:83:21:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if ((oldValue = getenv("XDG_CONFIG_HOME")) != NULL) {
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:91:27:  [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.
    strcpy(expectedValue, getenv("HOME"));
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:106:22:  [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* oldValue = getenv("XDG_CONFIG_HOME");
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:125:21:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if ((oldValue = getenv("XDG_CACHE_HOME")) != NULL) {
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:133:27:  [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.
    strcpy(expectedValue, getenv("HOME"));
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:148:22:  [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* oldValue = getenv("XDG_CACHE_HOME");
data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c:253:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buffer[3];
data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c:254:24:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        FILE* binary = fopen(appimage_path, "rt");
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:245: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 (dest, "w+");
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:254: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 buf[bytes_at_a_time];
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:444: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 symlink_target_path[size];
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:547: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(*buffer + (i*read_buf_size), ptr->data, read_buf_size);
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:551: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(*buffer + ((length-1)*read_buf_size), ptr->data, (size_t) size);
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:713:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buffer[3];
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:714:24:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        FILE *binary = fopen(appimage_path, "rt");
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:1725: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 path[1024];
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:2021: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).
    FILE *f = fopen(path, "rt");
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:2024:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buffer[3] = {0};
data/libappimage-0.1.9+dfsg/src/libappimage/type1.c:102:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int f = open(target, O_WRONLY | O_CREAT | O_TRUNC, mode);
data/libappimage-0.1.9+dfsg/src/libappimage/type1.c:185: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).
    FILE* f = fopen(path, "rt");
data/libappimage-0.1.9+dfsg/src/libappimage/type1.c:187:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buffer[5] = {0};
data/libappimage-0.1.9+dfsg/src/libappimage/type2.c:77: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[size];
data/libappimage-0.1.9+dfsg/src/libappimage_hashlib/md5.c:236: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( &Context->buffer[used], Buffer, BufferSize );
data/libappimage-0.1.9+dfsg/src/libappimage_hashlib/md5.c:240: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( &Context->buffer[used], Buffer, free );
data/libappimage-0.1.9+dfsg/src/libappimage_hashlib/md5.c:252: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( Context->buffer, Buffer, BufferSize );
data/libappimage-0.1.9+dfsg/src/libappimage_shared/digest.c:28:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    FILE *fp = fopen(path, "r");
data/libappimage-0.1.9+dfsg/src/libappimage_shared/digest.c:41:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buffer[chunk_size];
data/libappimage-0.1.9+dfsg/src/libappimage_shared/digest.c:134: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(digest, (const char*) checksum.bytes, 16);
data/libappimage-0.1.9+dfsg/src/libappimage_shared/elf.c:125:7:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = fopen(fname, "rb");
data/libappimage-0.1.9+dfsg/src/libappimage_shared/elf.c:160:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	int fd = open(fname, O_RDONLY);
data/libappimage-0.1.9+dfsg/src/libappimage_shared/elf.c:209:11:  [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 ((f = fopen(fname, "r")) == NULL) {
data/libappimage-0.1.9+dfsg/src/libappimage_shared/hexlify.c:12:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buffer[3];
data/libappimage-0.1.9+dfsg/src/libappimage_shared/hexlify.c:13:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(buffer, "%02x", (unsigned char) bytes[i]);
data/libappimage-0.1.9+dfsg/src/libappimage_shared/light_elf.h:44: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 e_ident[EI_NIDENT];
data/libappimage-0.1.9+dfsg/src/libappimage_shared/light_elf.h: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 e_ident[EI_NIDENT]; /* ELF "magic number" */
data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.h:172:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	int (*open) (const char *, struct fuse_file_info *);
data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.h:194:24:  [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.
	int (*utimens) (const char *, const struct timespec tv[2]);
data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.h:223: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).
  void (*open) (fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi);
data/libappimage-0.1.9+dfsg/tests/file_management_utils.hpp:54:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fin = open(source, O_RDONLY);
data/libappimage-0.1.9+dfsg/tests/file_management_utils.hpp:55:16:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fout = open(target, O_WRONLY | O_CREAT, S_IRWXU);
data/libappimage-0.1.9+dfsg/tests/file_management_utils.hpp:61: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[BUF_SIZE];
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:50:5:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
    strcat(expectedValue, "/.local/share");
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:92:5:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
    strcat(expectedValue, "/.config");
data/libappimage-0.1.9+dfsg/tests/test-xdg-basedir.cpp:134:5:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
    strcat(expectedValue, "/.cache");
data/libappimage-0.1.9+dfsg/tests/test_libappimage.cpp:605: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 digest[16];
data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c:179:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        unsigned long new_exec_value_size = strlen(appimage_path) + 1;
data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c:182:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            new_exec_value_size += strlen(field_value) + 1;
data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c:189:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (field_value != NULL && strlen(field_value) > 0) {
data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c:190:13:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
            strcat(new_exec_value, " ");
data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c:434: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).
                if (strlen(version_suffix) > strlen(old_contents) &&
data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c:434:46:  [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(version_suffix) > strlen(old_contents) &&
data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c:435:44:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                    strcmp(old_contents + (strlen(old_contents) - strlen(version_suffix)), version_suffix) != 0) {
data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c:435:67:  [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).
                    strcmp(old_contents + (strlen(old_contents) - strlen(version_suffix)), version_suffix) != 0) {
data/libappimage-0.1.9+dfsg/src/libappimage/desktop_integration.c:569:51:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            icon_name = strdup(icon_field_value + strlen(expected_icon_prefix));
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:104:59:  [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).
        g_checksum_update(checksum, (const guchar *) uri, strlen (uri));
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:640:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        unsigned long new_exec_value_size = strlen(appimage_path) + 1;
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:643:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            new_exec_value_size += strlen(field_value) + 1;
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:650:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (field_value != NULL && strlen(field_value) > 0) {
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:651:13:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
            strcat(new_exec_value, " ");
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:891: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).
                if (strlen(version_suffix) > strlen(old_contents) && strcmp(old_contents + (strlen(old_contents) - strlen(version_suffix)), version_suffix) != 0) {
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:891:46:  [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(version_suffix) > strlen(old_contents) && strcmp(old_contents + (strlen(old_contents) - strlen(version_suffix)), version_suffix) != 0) {
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:891:93:  [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(version_suffix) > strlen(old_contents) && strcmp(old_contents + (strlen(old_contents) - strlen(version_suffix)), version_suffix) != 0) {
data/libappimage-0.1.9+dfsg/src/libappimage/libappimage.c:891:116:  [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(version_suffix) > strlen(old_contents) && strcmp(old_contents + (strlen(old_contents) - strlen(version_suffix)), version_suffix) != 0) {
data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.h:154:10:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
  mode_t umask;
data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.h:173:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	int (*read) (const char *, char *, size_t, off_t, struct fuse_file_info *);
data/libappimage-0.1.9+dfsg/src/patches/squashfuse_dlopen.h:224:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  void (*read) (fuse_req_t req, fuse_ino_t ino, size_t size, off_t off, struct fuse_file_info *fi);
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:16:30:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        config_home = calloc(strlen(home) + strlen(suffix) + 1, sizeof(char));
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:16:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        config_home = calloc(strlen(home) + strlen(suffix) + 1, sizeof(char));
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:36:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        data_home = calloc(strlen(home) + strlen(suffix) + 1, sizeof(char));
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:36:43:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        data_home = calloc(strlen(home) + strlen(suffix) + 1, sizeof(char));
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:56:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        cache_home = calloc(strlen(home) + strlen(suffix) + 1, sizeof(char));
data/libappimage-0.1.9+dfsg/src/xdg-basedir/xdg-basedir.c:56:44:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        cache_home = calloc(strlen(home) + strlen(suffix) + 1, sizeof(char));
data/libappimage-0.1.9+dfsg/tests/file_management_utils.hpp:63:43:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((bs_read = static_cast<size_t>(read(fin, &buf, BUF_SIZE))) != 0)
data/libappimage-0.1.9+dfsg/tests/test_libappimage.cpp:197:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (file.read(buffer.data(), size))
data/libappimage-0.1.9+dfsg/tests/test_libappimage.cpp:198:54:  [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_TRUE(strncmp(expected, buffer.data(), strlen(expected)) == 0);
data/libappimage-0.1.9+dfsg/tests/test_libappimage.cpp:224:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    EXPECT_EQ(bufsize, strlen(expected));
data/libappimage-0.1.9+dfsg/tests/test_libappimage.cpp:249:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    EXPECT_EQ(bufsize, strlen(expected));
data/libappimage-0.1.9+dfsg/tests/test_libappimage.cpp:628:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ifs.read(buffer.data(), buffer.size());
data/libappimage-0.1.9+dfsg/tests/test_libappimage.cpp:670:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    originalStrm.read(originalData.data(), originalData.size());
data/libappimage-0.1.9+dfsg/tests/test_libappimage.cpp:671:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    installedStrm.read(installedData.data(), installedData.size());

ANALYSIS SUMMARY:

Hits = 118
Lines analyzed = 6465 in approximately 0.28 seconds (23433 lines/second)
Physical Source Lines of Code (SLOC) = 4311
Hits@level = [0] 122 [1]  35 [2]  39 [3]  21 [4]  17 [5]   6
Hits@level+ = [0+] 240 [1+] 118 [2+]  83 [3+]  44 [4+]  23 [5+]   6
Hits/KSLOC@level+ = [0+] 55.6715 [1+] 27.3718 [2+] 19.2531 [3+] 10.2064 [4+] 5.33519 [5+] 1.39179
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.