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/libvirt-php-0.5.5/src/libvirt-connection.c
Examining data/libvirt-php-0.5.5/src/libvirt-connection.h
Examining data/libvirt-php-0.5.5/src/libvirt-domain.c
Examining data/libvirt-php-0.5.5/src/libvirt-domain.h
Examining data/libvirt-php-0.5.5/src/libvirt-network.c
Examining data/libvirt-php-0.5.5/src/libvirt-network.h
Examining data/libvirt-php-0.5.5/src/libvirt-node.c
Examining data/libvirt-php-0.5.5/src/libvirt-node.h
Examining data/libvirt-php-0.5.5/src/libvirt-nodedev.c
Examining data/libvirt-php-0.5.5/src/libvirt-nodedev.h
Examining data/libvirt-php-0.5.5/src/libvirt-nwfilter.c
Examining data/libvirt-php-0.5.5/src/libvirt-nwfilter.h
Examining data/libvirt-php-0.5.5/src/libvirt-php.c
Examining data/libvirt-php-0.5.5/src/libvirt-php.h
Examining data/libvirt-php-0.5.5/src/libvirt-snapshot.c
Examining data/libvirt-php-0.5.5/src/libvirt-snapshot.h
Examining data/libvirt-php-0.5.5/src/libvirt-storage.c
Examining data/libvirt-php-0.5.5/src/libvirt-storage.h
Examining data/libvirt-php-0.5.5/src/libvirt-stream.c
Examining data/libvirt-php-0.5.5/src/libvirt-stream.h
Examining data/libvirt-php-0.5.5/src/sockets.c
Examining data/libvirt-php-0.5.5/src/sockets.h
Examining data/libvirt-php-0.5.5/src/util.c
Examining data/libvirt-php-0.5.5/src/util.h
Examining data/libvirt-php-0.5.5/src/vncfunc.c
Examining data/libvirt-php-0.5.5/src/vncfunc.h
Examining data/libvirt-php-0.5.5/tools/generate-api-docs.c
Examining data/libvirt-php-0.5.5/winsrc/include/iconv.h
Examining data/libvirt-php-0.5.5/winsrc/include/libvirt/libvirt-lxc.h
Examining data/libvirt-php-0.5.5/winsrc/include/libvirt/libvirt-qemu.h
Examining data/libvirt-php-0.5.5/winsrc/include/libvirt/libvirt.h
Examining data/libvirt-php-0.5.5/winsrc/include/libvirt/virterror.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/DOCBparser.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/HTMLparser.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/HTMLtree.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/SAX.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/SAX2.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/c14n.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/catalog.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/chvalid.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/debugXML.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/dict.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/encoding.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/entities.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/globals.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/hash.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/list.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/nanoftp.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/nanohttp.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/parser.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/parserInternals.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/pattern.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/relaxng.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/schemasInternals.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/schematron.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/threads.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/tree.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/uri.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/valid.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xinclude.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xlink.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlIO.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlautomata.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlerror.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlexports.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlmemory.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlmodule.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlreader.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlregexp.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlsave.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlschemas.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlschemastypes.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlstring.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlunicode.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlversion.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlwin32version.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xmlwriter.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xpath.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xpathInternals.h
Examining data/libvirt-php-0.5.5/winsrc/include/libxml/xpointer.h
Examining data/libvirt-php-0.5.5/winsrc/stdafx.cpp
Examining data/libvirt-php-0.5.5/winsrc/stdafx.h

FINAL RESULTS:

data/libvirt-php-0.5.5/src/libvirt-php.c:2264:13:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
            chmod(path, 0666);
data/libvirt-php-0.5.5/src/libvirt-connection.c:409:16:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    FILE *fp = popen(cmd, "r");
data/libvirt-php-0.5.5/src/libvirt-connection.c:481:16:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    FILE *fp = popen(cmd, "r");
data/libvirt-php-0.5.5/src/libvirt-connection.c:512:21:  [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(desc, t.tokens[i]);
data/libvirt-php-0.5.5/src/libvirt-domain.c:2699:28:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if ((path == NULL) || (access(path, X_OK) != 0)) {
data/libvirt-php-0.5.5/src/libvirt-domain.c:2752:22:  [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.
            retval = execlp(path, basename(pathDup), tmpp, file, NULL);
data/libvirt-php-0.5.5/src/libvirt-domain.c:2780:9:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (access(file, F_OK) == 0) {
data/libvirt-php-0.5.5/src/libvirt-domain.c:2871:22:  [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.
        exitStatus = system(tmp);
data/libvirt-php-0.5.5/src/libvirt-php.c:593:9:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (access(filename, F_OK) == 0) {
data/libvirt-php-0.5.5/src/libvirt-php.c:777:17:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
            if (access(features_binaries[i], X_OK) == 0)
data/libvirt-php-0.5.5/src/libvirt-php.c:836:11:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (!(access(LIBVIRT_G(iso_path_ini), F_OK) == 0))
data/libvirt-php-0.5.5/src/libvirt-php.c:844:11:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (!(access(LIBVIRT_G(image_path_ini), F_OK) == 0))
data/libvirt-php-0.5.5/src/libvirt-php.c:857: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(features_supported, features[i]);
data/libvirt-php-0.5.5/src/libvirt-php.c:1599: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.
    cmdRet = system(cmd);
data/libvirt-php-0.5.5/src/libvirt-php.c:1601:37:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (WEXITSTATUS(cmdRet) == 0 && access(fpath, F_OK) == 0) {
data/libvirt-php-0.5.5/src/libvirt-php.c:2228:9:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (access(path, R_OK) != 0) {
data/libvirt-php-0.5.5/src/libvirt-php.c:2253:22:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        int cmdRet = system(cmd);
data/libvirt-php-0.5.5/src/libvirt-php.c:2375:22:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (iso_image && access(iso_image, R_OK) != 0) {
data/libvirt-php-0.5.5/src/libvirt-php.c:2388: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(disks_xml, disk);
data/libvirt-php-0.5.5/src/libvirt-php.c:2397: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(networks_xml, network);
data/libvirt-php-0.5.5/src/util.c:60:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        vfprintf(stderr, fmt, args);
data/libvirt-php-0.5.5/tools/generate-api-docs.c:26:5:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    vsnprintf(tmp, sizeof(tmp), fmt, ap);
data/libvirt-php-0.5.5/tools/generate-api-docs.c:76: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(functions[func_num].args[0], str);
data/libvirt-php-0.5.5/tools/generate-api-docs.c:84: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(functions[func_num].returns, str);
data/libvirt-php-0.5.5/tools/generate-api-docs.c:91: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(functions[func_num].args[functions[func_num].num_args-1], ltrimmed);
data/libvirt-php-0.5.5/tools/generate-api-docs.c:174:9:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (access(argv[idx], R_OK) != 0)
data/libvirt-php-0.5.5/src/libvirt-php.c:2174:5:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    srand(time(NULL));
data/libvirt-php-0.5.5/src/libvirt-connection.c:80:39:  [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.
                    cred[i].result = (char *)malloc(creds[j].resultlen + 1);
data/libvirt-php-0.5.5/src/libvirt-connection.c:274:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char hvStr[64] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-connection.c:404: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[4096] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-connection.c:405: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 tmp2[16]  = { 0 };
data/libvirt-php-0.5.5/src/libvirt-connection.c:477: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[4096] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-connection.c:503: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 desc[1024] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-connection.c:522:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                char tmp2[16] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-connection.c:626: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 hvStr[64] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-connection.c:723: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 tmp[1024] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-connection.c:733:21:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                    char tmp2[1024] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-connection.c:745:29:  [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 key[8] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-connection.c:746:29:  [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 tmp3[2048] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-connection.c:778:29:  [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 key[8] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-connection.c:779:29:  [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 tmp3[2048] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-domain.c:87: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 vncl[2048] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-domain.c:91:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char uuid[VIR_UUID_STRING_BUFLEN] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-domain.c:526: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 newXml[512] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-domain.c:565: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(tmp2, xml, len);
data/libvirt-php-0.5.5/src/libvirt-domain.c:612: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 newXml[4096] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-domain.c:646: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(tmp2, xml, len);
data/libvirt-php-0.5.5/src/libvirt-domain.c:2693: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 name[1024] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-domain.c:2722:9:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    if (mkstemp(file) == 0)
data/libvirt-php-0.5.5/src/libvirt-domain.c:2740:16:  [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).
        port = atoi(tmp)-5900;
data/libvirt-php-0.5.5/src/libvirt-domain.c:2749: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 tmpp[64] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-domain.c:2768: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).
    fd = open(file, O_RDONLY);
data/libvirt-php-0.5.5/src/libvirt-domain.c:2843:16:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    if (!(fd = mkstemp(file))) {
data/libvirt-php-0.5.5/src/libvirt-domain.c:2865: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 tmp[4096] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-domain.c:2866: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 fileNew[1024] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-domain.c:2941: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 error[1024] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-domain.c:3014: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 tmpp[64] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-domain.c:3128: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 error[1024] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-network.c:284: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 fixedtemp[32] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-node.c:75: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 tmp[256] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-nwfilter.c:148: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 uuid[VIR_UUID_STRING_BUFLEN];
data/libvirt-php-0.5.5/src/libvirt-php.c:812: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 path[1024];
data/libvirt-php-0.5.5/src/libvirt-php.c:813: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 tmp[1024] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:828: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 version[100];
data/libvirt-php-0.5.5/src/libvirt-php.c:853: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 features_supported[4096] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:858:13:  [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(features_supported, ", ");
data/libvirt-php-0.5.5/src/libvirt-php.c:1139:12:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    return atoi(arg) * multiplicator;
data/libvirt-php-0.5.5/src/libvirt-php.c:1154: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 name[1024];
data/libvirt-php-0.5.5/src/libvirt-php.c:1554: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 msg[1024];
data/libvirt-php-0.5.5/src/libvirt-php.c:1555: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[4096] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:1557: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 fpath[4096] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:1623: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 name[1024];
data/libvirt-php-0.5.5/src/libvirt-php.c:1624: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 msg[4096] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:1679: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 key[8] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:1901: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 temp[128] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:1935: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 tmp[4] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:1944:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            retval += (atoi(tmp) * pow(256, 3 - part));
data/libvirt-php-0.5.5/src/libvirt-php.c:1952:16:  [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).
    retval += (atoi(tmp) * pow(256, 3 - part));
data/libvirt-php-0.5.5/src/libvirt-php.c:2038: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 xpath[1024] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:2170: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 a[37] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:2223: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 xml[4096] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:2235: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 cmd[4096] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:2290: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 xml[4096] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:2343: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 disks_xml[16384] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:2344: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 networks_xml[16384] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:2345: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 features[128] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:2347: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 type[64] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:2359:9:  [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(features, "<acpi/>");
data/libvirt-php-0.5.5/src/libvirt-php.c:2361:9:  [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(features, "<apic/>");
data/libvirt-php-0.5.5/src/libvirt-php.c:2363:9:  [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(features, "<pae/>");
data/libvirt-php-0.5.5/src/libvirt-php.c:2747: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 tmp[256] = { 0 };
data/libvirt-php-0.5.5/src/libvirt-php.c:2797: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 tmp[1024] = { 0 };
data/libvirt-php-0.5.5/src/sockets.c:47: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 name[1024] = { 0 };
data/libvirt-php-0.5.5/src/sockets.c:165: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 bigbuf[1048576];
data/libvirt-php-0.5.5/src/sockets.c:210: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 bigbuf[1048576];
data/libvirt-php-0.5.5/src/sockets.c:216: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).
    fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0644);
data/libvirt-php-0.5.5/src/util.h:238: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 tmpnumber[64]
data/libvirt-php-0.5.5/src/vncfunc.c:77: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[12];
data/libvirt-php-0.5.5/src/vncfunc.c:117: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[4] = { 0 };
data/libvirt-php-0.5.5/src/vncfunc.c:118: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 buf2[32] = { 0 };
data/libvirt-php-0.5.5/src/vncfunc.c:257: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[8];
data/libvirt-php-0.5.5/src/vncfunc.c:298: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[6] = { 0 };
data/libvirt-php-0.5.5/src/vncfunc.c:336: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[20];
data/libvirt-php-0.5.5/src/vncfunc.c:393: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[8];
data/libvirt-php-0.5.5/src/vncfunc.c:439: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[10];
data/libvirt-php-0.5.5/src/vncfunc.c:496: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[1024] = { 0 };
data/libvirt-php-0.5.5/src/vncfunc.c:541: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 tmpbuf[25] = { 0 };
data/libvirt-php-0.5.5/src/vncfunc.c:558: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, tmpbuf, sizeof(tmpbuf));
data/libvirt-php-0.5.5/src/vncfunc.c:644: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[8192] = { 0 };
data/libvirt-php-0.5.5/src/vncfunc.c:645: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 tbuf[4] = { 0 };
data/libvirt-php-0.5.5/src/vncfunc.c:649: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).
    fd = open(infile, O_RDONLY);
data/libvirt-php-0.5.5/src/vncfunc.c:671: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).
    fd2 = open(outfile, O_WRONLY | O_CREAT | O_TRUNC, 0644);
data/libvirt-php-0.5.5/src/vncfunc.c:733:9:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    if (mkstemp(file) == 0)
data/libvirt-php-0.5.5/tools/generate-api-docs.c:23: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 tmp[64] = { 0 };
data/libvirt-php-0.5.5/tools/generate-api-docs.c:150:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char line[1024] = { 0 };
data/libvirt-php-0.5.5/tools/generate-api-docs.c:180: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).
    if (!(fp = fopen(argv[idx], "r")))
data/libvirt-php-0.5.5/tools/generate-api-docs.c:213: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).
    if (!(fp = fopen(argv[idx+1], "w"))) {
data/libvirt-php-0.5.5/winsrc/include/libvirt/libvirt.h:393:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char label[VIR_SECURITY_LABEL_BUFLEN];    /* security label string */
data/libvirt-php-0.5.5/winsrc/include/libvirt/libvirt.h:427: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 model[VIR_SECURITY_MODEL_BUFLEN];      /* security model string */
data/libvirt-php-0.5.5/winsrc/include/libvirt/libvirt.h:428:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char doi[VIR_SECURITY_DOI_BUFLEN];          /* domain of interpetation */
data/libvirt-php-0.5.5/winsrc/include/libvirt/libvirt.h:503: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 field[VIR_TYPED_PARAM_FIELD_LENGTH];  /* parameter name */
data/libvirt-php-0.5.5/winsrc/include/libvirt/libvirt.h:631: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 model[32];       /* string indicating the CPU model */
data/libvirt-php-0.5.5/winsrc/include/libvirt/libvirt.h:712: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 field[VIR_NODE_CPU_STATS_FIELD_LENGTH];
data/libvirt-php-0.5.5/winsrc/include/libvirt/libvirt.h:774: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 field[VIR_NODE_MEMORY_STATS_FIELD_LENGTH];
data/libvirt-php-0.5.5/winsrc/include/libvirt/libvirt.h:2345: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(cpumap, VIR_GET_CPUMAP(cpumaps, maplen, vcpu), maplen)
data/libvirt-php-0.5.5/winsrc/include/libxml/chvalid.h:191:20:  [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.
XMLPUBVAR unsigned char xmlIsPubidChar_tab[256];
data/libvirt-php-0.5.5/src/libvirt-connection.c:82:21:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                    strncpy(cred[i].result, creds[j].result, creds[j].resultlen);
data/libvirt-php-0.5.5/src/libvirt-connection.c:187:21:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                    strncpy(creds[j].result, Z_STRVAL_P(data), Z_STRLEN_P(data));
data/libvirt-php-0.5.5/src/libvirt-connection.c:498:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(cmd) < 2)
data/libvirt-php-0.5.5/src/libvirt-connection.c:514:25:  [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(desc, " ");
data/libvirt-php-0.5.5/src/libvirt-connection.c:763:62:  [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).
                                add_assoc_zval_ex(arr2, key, strlen(key) + 1, arr4);
data/libvirt-php-0.5.5/src/libvirt-connection.c:797:62:  [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).
                                add_assoc_zval_ex(arr3, key, strlen(key) + 1, arr4);
data/libvirt-php-0.5.5/src/libvirt-connection.c:804:58:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                        add_assoc_zval_ex(arr2, ret2[j], strlen(ret2[j]) + 1, arr3);
data/libvirt-php-0.5.5/src/libvirt-connection.c:809:57:  [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).
                add_assoc_zval_ex(return_value, ret[i], strlen(ret[i]) + 1, arr2);
data/libvirt-php-0.5.5/src/libvirt-connection.c:878:75:  [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).
        zend_hash_update(Z_ARRVAL_P(return_value), zend_string_init(name, strlen(name), 0), arr2);
data/libvirt-php-0.5.5/src/libvirt-connection.c:880:58:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        zend_hash_update(Z_ARRVAL_P(return_value), name, strlen(name)+1, &arr2, sizeof(arr2), NULL);
data/libvirt-php-0.5.5/src/libvirt-domain.c:555: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).
    tmp1 = strstr(xml, "</currentMemory>") + strlen("</currentMemory>");
data/libvirt-php-0.5.5/src/libvirt-domain.c:561:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(xml) - strlen(tmpA);
data/libvirt-php-0.5.5/src/libvirt-domain.c:561:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(xml) - strlen(tmpA);
data/libvirt-php-0.5.5/src/libvirt-domain.c:567: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).
    new_len = strlen(tmp1) + strlen(tmp2) + strlen(newXml) + 2;
data/libvirt-php-0.5.5/src/libvirt-domain.c:567: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).
    new_len = strlen(tmp1) + strlen(tmp2) + strlen(newXml) + 2;
data/libvirt-php-0.5.5/src/libvirt-domain.c:567: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).
    new_len = strlen(tmp1) + strlen(tmp2) + strlen(newXml) + 2;
data/libvirt-php-0.5.5/src/libvirt-domain.c:639:37:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    tmpA = strstr(xml, "</type>") + strlen("</type>");
data/libvirt-php-0.5.5/src/libvirt-domain.c:642:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(xml) - strlen(tmpA);
data/libvirt-php-0.5.5/src/libvirt-domain.c:642:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(xml) - strlen(tmpA);
data/libvirt-php-0.5.5/src/libvirt-domain.c:648: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).
    new_len = strlen(tmp1) + strlen(tmp2) + strlen(newXml) + 2;
data/libvirt-php-0.5.5/src/libvirt-domain.c:648: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).
    new_len = strlen(tmp1) + strlen(tmp2) + strlen(newXml) + 2;
data/libvirt-php-0.5.5/src/libvirt-domain.c:648: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).
    new_len = strlen(tmp1) + strlen(tmp2) + strlen(newXml) + 2;
data/libvirt-php-0.5.5/src/libvirt-domain.c:2570:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if ((uri != NULL) && (strlen(uri) == 0))
data/libvirt-php-0.5.5/src/libvirt-domain.c:2610:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if ((key != NULL) && (strlen(key) == 0))
data/libvirt-php-0.5.5/src/libvirt-domain.c:2612:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if ((uri != NULL) && (strlen(uri) == 0))
data/libvirt-php-0.5.5/src/libvirt-domain.c:2773:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(fd, buf, fsize) < 0) {
data/libvirt-php-0.5.5/src/libvirt-domain.c:2994:65:  [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).
    DPRINTF("%s: Sending %d VNC keys to %s...\n", PHPFUNC, (int)strlen((const char *)keys), hostname);
data/libvirt-php-0.5.5/src/libvirt-domain.c:3008:87:  [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).
    DPRINTF("%s: About to send string '%s' (%d keys) to %s:%s\n", PHPFUNC, keys, (int)strlen((const char *)keys), hostname, tmp);
data/libvirt-php-0.5.5/src/libvirt-network.c:324: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).
        ipaddr[strlen(ipaddr) - 1] = ipaddr[strlen(ipaddr) - 1] - 1;
data/libvirt-php-0.5.5/src/libvirt-network.c:324: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).
        ipaddr[strlen(ipaddr) - 1] = ipaddr[strlen(ipaddr) - 1] - 1;
data/libvirt-php-0.5.5/src/libvirt-php.c:862:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (strlen(features_supported) > 0) {
data/libvirt-php-0.5.5/src/libvirt-php.c:863: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).
        features_supported[strlen(features_supported) - 2] = 0;
data/libvirt-php-0.5.5/src/libvirt-php.c:888: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).
    LIBVIRT_G(last_error) = estrndup(msg, strlen(msg));
data/libvirt-php-0.5.5/src/libvirt-php.c:908: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).
    LIBVIRT_G(vnc_location) = estrndup(msg, strlen(msg));
data/libvirt-php-0.5.5/src/libvirt-php.c:1121:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if ((arg == NULL) || (strlen(arg) == 0))
data/libvirt-php-0.5.5/src/libvirt-php.c:1124: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).
    unit = arg[strlen(arg)-1];
data/libvirt-php-0.5.5/src/libvirt-php.c:1137:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        arg[strlen(arg) - 1] = 0;
data/libvirt-php-0.5.5/src/libvirt-php.c:1941: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).
    for (i = 0; i < (int)strlen(ip); i++) {
data/libvirt-php-0.5.5/src/libvirt-php.c:1956: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).
    for (i = 0; i < (int)strlen(binary); i++) {
data/libvirt-php-0.5.5/src/libvirt-php.c:2179: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).
            a[i] = hexa[rand() % strlen(hexa)];
data/libvirt-php-0.5.5/src/libvirt-php.c:2721: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).
            if (strcasecmp(entry->d_name + strlen(entry->d_name) - 4, ".iso") == 0) {
data/libvirt-php-0.5.5/src/sockets.c:175:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            while ((len = read(sfd, bigbuf, sizeof(bigbuf))) == sizeof(bigbuf)) ;
data/libvirt-php-0.5.5/src/sockets.c:182:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        len = read(sfd, bigbuf, sizeof(bigbuf));
data/libvirt-php-0.5.5/src/sockets.c:190:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        read(sfd, bigbuf, length) != length)
data/libvirt-php-0.5.5/src/sockets.c:227:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        len = read(sfd, bigbuf, sizeof(bigbuf));
data/libvirt-php-0.5.5/src/sockets.c:241:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        len = read(sfd, bigbuf, length);
data/libvirt-php-0.5.5/src/vncfunc.c:122:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((num = read(sfd, buf, 1)) < 0) {
data/libvirt-php-0.5.5/src/vncfunc.c:130:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(sfd, buf2, num) < 0) {
data/libvirt-php-0.5.5/src/vncfunc.c:165:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (read(sfd, buf, 4) < 0) {
data/libvirt-php-0.5.5/src/vncfunc.c:504:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(sfd, buf, 1024) < 0) {
data/libvirt-php-0.5.5/src/vncfunc.c:546:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(sfd, tmpbuf, 24) < 0) {
data/libvirt-php-0.5.5/src/vncfunc.c:560:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((len = read(sfd, buf + 24, namelen)) < 0) {
data/libvirt-php-0.5.5/src/vncfunc.c:685:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((len = read(fd, buf, sizeof(buf))) > 0) {
data/libvirt-php-0.5.5/src/vncfunc.c:800:87:  [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).
    DPRINTF("%s: About to process key sequence '%s' (%d keys)\n", VNCFUNC, keys, (int)strlen(keys));
data/libvirt-php-0.5.5/src/vncfunc.c:801: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).
    for (i = 0; i < strlen(keys); i++) {
data/libvirt-php-0.5.5/src/vncfunc.c:808:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if ((keys[i] == '\\') && (strlen(keys) > i + 1)) {
data/libvirt-php-0.5.5/src/vncfunc.c:825:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(50000);
data/libvirt-php-0.5.5/src/vncfunc.c:828:53:  [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).
    DPRINTF("%s: All %d keys sent\n", VNCFUNC, (int)strlen(keys));
data/libvirt-php-0.5.5/src/vncfunc.c:880:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(50000);
data/libvirt-php-0.5.5/tools/generate-api-docs.c:75: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).
        functions[func_num].args[0] = malloc( (strlen(str) + 1) * sizeof(char) );
data/libvirt-php-0.5.5/tools/generate-api-docs.c:83: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).
        functions[func_num].returns = malloc( (strlen(str) + 1) * sizeof(char));
data/libvirt-php-0.5.5/tools/generate-api-docs.c:90:76:  [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).
        functions[func_num].args[functions[func_num].num_args-1] = malloc((strlen(ltrimmed) + 1) * sizeof(char) );
data/libvirt-php-0.5.5/tools/generate-api-docs.c:106:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    new[ strlen(new) - strlen(tmp) ] = 0;
data/libvirt-php-0.5.5/tools/generate-api-docs.c:106: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).
    new[ strlen(new) - strlen(tmp) ] = 0;
data/libvirt-php-0.5.5/tools/generate-api-docs.c:193:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (line[strlen(line) - 1] == '\n')
data/libvirt-php-0.5.5/tools/generate-api-docs.c:194: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).
            line[strlen(line) - 1] = 0;
data/libvirt-php-0.5.5/tools/generate-api-docs.c:236: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).
                    decrement = (part != NULL) ? strlen( part ) : 0;
data/libvirt-php-0.5.5/tools/generate-api-docs.c:241: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).
                    new[ strlen(new) - decrement ] = 0;
data/libvirt-php-0.5.5/tools/generate-api-docs.c:267: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).
                    decrement = (part != NULL) ? strlen( part ) : 0;
data/libvirt-php-0.5.5/tools/generate-api-docs.c:272: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).
                    new[ strlen(new) - decrement ] = 0;

ANALYSIS SUMMARY:

Hits = 196
Lines analyzed = 32778 in approximately 0.86 seconds (38000 lines/second)
Physical Source Lines of Code (SLOC) = 20097
Hits@level = [0] 103 [1]  70 [2]  99 [3]   1 [4]  25 [5]   1
Hits@level+ = [0+] 299 [1+] 196 [2+] 126 [3+]  27 [4+]  26 [5+]   1
Hits/KSLOC@level+ = [0+] 14.8778 [1+] 9.7527 [2+] 6.26959 [3+] 1.34348 [4+] 1.29373 [5+] 0.0497587
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.