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/libkarma-0.1.2/src/karma.c
Examining data/libkarma-0.1.2/src/karma.h
Examining data/libkarma-0.1.2/src/playlist.c
Examining data/libkarma-0.1.2/src/playlist.h
Examining data/libkarma-0.1.2/src/lkarma.h
Examining data/libkarma-0.1.2/src/fdb.c
Examining data/libkarma-0.1.2/src/fdb.h
Examining data/libkarma-0.1.2/src/md5.c
Examining data/libkarma-0.1.2/src/md5.h
Examining data/libkarma-0.1.2/src/mp3.c
Examining data/libkarma-0.1.2/src/mp3.h
Examining data/libkarma-0.1.2/src/wav.c
Examining data/libkarma-0.1.2/src/wav.h
Examining data/libkarma-0.1.2/src/errors.c
Examining data/libkarma-0.1.2/src/hash.c
Examining data/libkarma-0.1.2/src/hash.h
Examining data/libkarma-0.1.2/src/properties.c
Examining data/libkarma-0.1.2/src/properties.h
Examining data/libkarma-0.1.2/src/rio_rw.c
Examining data/libkarma-0.1.2/src/rio_rw.h
Examining data/libkarma-0.1.2/src/ssdp.c
Examining data/libkarma-0.1.2/src/ssdp.h
Examining data/libkarma-0.1.2/src/utf8.c
Examining data/libkarma-0.1.2/src/utf8.h
Examining data/libkarma-0.1.2/src/util.c
Examining data/libkarma-0.1.2/src/util.h
Examining data/libkarma-0.1.2/src/status.c
Examining data/libkarma-0.1.2/src/status.h
Examining data/libkarma-0.1.2/src/mountSearch.c
Examining data/libkarma-0.1.2/src/karmaLan.c
Examining data/libkarma-0.1.2/src/karmaLan.h
Examining data/libkarma-0.1.2/src/karmaUsb.c
Examining data/libkarma-0.1.2/src/karmaUsb.h
Examining data/libkarma-0.1.2/tools/ftw.c
Examining data/libkarma-0.1.2/tools/ftw.h
Examining data/libkarma-0.1.2/tools/riocp.c
Examining data/libkarma-0.1.2/tools/karma_helper.c
Examining data/libkarma-0.1.2/tools/playlist_show.c
Examining data/libkarma-0.1.2/tools/chprop.c
Examining data/libkarma-0.1.2/tools/pathedit.c
Examining data/libkarma-0.1.2/tools/pathedit.h

FINAL RESULTS:

data/libkarma-0.1.2/src/mp3.c:271:5:  [5] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
    strncat(buf,mp3->id3.title,TEXT_FIELD_LEN);
data/libkarma-0.1.2/src/mp3.c:273:5:  [5] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
    strncat(buf,mp3->id3.artist,TEXT_FIELD_LEN);
data/libkarma-0.1.2/src/mp3.c:275:5:  [5] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
    strncat(buf,mp3->id3.album,TEXT_FIELD_LEN);
data/libkarma-0.1.2/src/mp3.c:277:5:  [5] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
    strncat(buf,mp3->id3.year,INT_FIELD_LEN);
data/libkarma-0.1.2/src/mp3.c:279:5:  [5] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
    strncat(buf,mp3->id3.comment,TEXT_FIELD_LEN);
data/libkarma-0.1.2/src/karmaUsb.c:61:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(path, "%sfids0/_%.8x", usbMountPoint, file_id);
data/libkarma-0.1.2/src/karmaUsb.c:82: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(usbMountPoint, path);
data/libkarma-0.1.2/src/karmaUsb.c:336: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(prop_strs[i], buf);
data/libkarma-0.1.2/src/karmaUsb.c:392:11:  [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).
    aux = strcpy(*properties + *offset, fidLine);
data/libkarma-0.1.2/src/karmaUsb.c:465: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(path, path1);
data/libkarma-0.1.2/src/karmaUsb.c:466: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(path, de0->d_name);
data/libkarma-0.1.2/src/karmaUsb.c:637:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(tmp, "%s%s", usbMountPoint, RK_SMALLDB);
data/libkarma-0.1.2/src/properties.c:158:5:  [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(p, key); \
data/libkarma-0.1.2/src/properties.c:160:5:  [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(p, (char*)data); \
data/libkarma-0.1.2/src/properties.c:726:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(tmp, "%s%s", usbMountPoint, RK_SMALLDB);
data/libkarma-0.1.2/src/rio_rw.c:209: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(filename, karma_tmpdir);
data/libkarma-0.1.2/src/rio_rw.c:478: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(bitrate, simple_itoa(brate));
data/libkarma-0.1.2/src/rio_rw.c:635:14:  [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).
        else strcat(bitrate, simple_itoa(i));
data/libkarma-0.1.2/tools/karma_helper.c:276: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 (request, riop);
data/libkarma-0.1.2/tools/karma_helper.c:289: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 (request, riop);
data/libkarma-0.1.2/tools/pathedit.c:137: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(a, expand(orig));
data/libkarma-0.1.2/tools/pathedit.c:138: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(b, expand(sub));
data/libkarma-0.1.2/tools/pathedit.c:139: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(d, expand(del));
data/libkarma-0.1.2/src/rio_rw.c:379:16:  [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.
        path = realpath(filename, fullpath+len+1);
data/libkarma-0.1.2/src/util.c:66:17:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    home=strdup(getenv("HOME"));
data/libkarma-0.1.2/tools/chprop.c:35:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((c = getopt(argc, argv, "ha:p:s:")) != -1) {
data/libkarma-0.1.2/tools/riocp.c:490:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((c = getopt(argc, argv, "dhqrRbwfFHLa:c:e:p:s:S:u:x:l:D:U:")) 
data/libkarma-0.1.2/src/errors.c:18:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
const char *lkerrorList[MAXLKERRORS + 1] = {
data/libkarma-0.1.2/src/errors.c:123: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.
    return (char *)lkerrorList[lkerrnum];
data/libkarma-0.1.2/src/fdb.c:25: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 *p, buf[64];
data/libkarma-0.1.2/src/fdb.c:38:11:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    ver = atoi(buf);
data/libkarma-0.1.2/src/fdb.c:169: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(*entry, p, len);
data/libkarma-0.1.2/src/karma.c:127: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[32];
data/libkarma-0.1.2/src/karma.c:129: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(path, "/dev/shm/lkarmaXXXXXX", 22);
data/libkarma-0.1.2/src/karma.c:130:10:  [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).
    fd = mkstemp(path);
data/libkarma-0.1.2/src/karma.c:137: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(path, "/tmp/lkarmaXXXXXX", 19);
data/libkarma-0.1.2/src/karma.c:138:10:  [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).
    fd = mkstemp(path);
data/libkarma-0.1.2/src/karmaLan.c:80: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[HEADERLENGTH];
data/libkarma-0.1.2/src/karmaLan.c:83: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(msg, RIO_HEADER, 4);
data/libkarma-0.1.2/src/karmaLan.c:86: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(&msg[4], &identifier, sizeof(identifier));
data/libkarma-0.1.2/src/karmaLan.c:107: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 sig[4];
data/libkarma-0.1.2/src/karmaLan.c:140: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 id[4];
data/libkarma-0.1.2/src/karmaLan.c:144: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(id, &r_id, sizeof(r_id));
data/libkarma-0.1.2/src/karmaLan.c:193: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 versions[8];
data/libkarma-0.1.2/src/karmaLan.c:197: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(versions, major_version, sizeof(major_version));
data/libkarma-0.1.2/src/karmaLan.c:198: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(&versions[4], minor_version, sizeof(minor_version));
data/libkarma-0.1.2/src/karmaLan.c:227: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 md5sum[16];
data/libkarma-0.1.2/src/karmaLan.c:237: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(md5input, salt, SALTLENGTH);
data/libkarma-0.1.2/src/karmaLan.c:238: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(&md5input[SALTLENGTH], pass, strlen(pass));
data/libkarma-0.1.2/src/karmaLan.c:279: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 id[4];
data/libkarma-0.1.2/src/karmaLan.c:282: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(id, &storage_id, sizeof(storage_id));
data/libkarma-0.1.2/src/karmaLan.c:338:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char p[4];
data/libkarma-0.1.2/src/karmaLan.c:341: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(p, &type, sizeof(type));
data/libkarma-0.1.2/src/karmaLan.c:367: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 p[16];
data/libkarma-0.1.2/src/karmaLan.c:372: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(p, &size, sizeof(size));
data/libkarma-0.1.2/src/karmaLan.c:373: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(&(p[4]), file_id, sizeof(file_id));
data/libkarma-0.1.2/src/karmaLan.c:374: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(&(p[12]), &storage_id, sizeof(storage_id));
data/libkarma-0.1.2/src/karmaLan.c:401: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(packet, &offset, sizeof(offset));
data/libkarma-0.1.2/src/karmaLan.c:402: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(&packet[8], &size, sizeof(size));
data/libkarma-0.1.2/src/karmaLan.c:404: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(&packet[16], &file_id, sizeof(file_id));
data/libkarma-0.1.2/src/karmaLan.c:405: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(&packet[20], &storage_id, sizeof(storage_id));
data/libkarma-0.1.2/src/karmaLan.c:406: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(&packet[24], data, size);
data/libkarma-0.1.2/src/karmaLan.c:446: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(packet, &file_id, sizeof(file_id));
data/libkarma-0.1.2/src/karmaLan.c:447: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(&packet[4], properties, len);
data/libkarma-0.1.2/src/karmaLan.c:467: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 p[20];
data/libkarma-0.1.2/src/karmaLan.c:475: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(&p, &offset, sizeof(offset));
data/libkarma-0.1.2/src/karmaLan.c:476: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(&p[8], &size, sizeof(size));
data/libkarma-0.1.2/src/karmaLan.c:477: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(&p[16], &file_id, sizeof(file_id));
data/libkarma-0.1.2/src/karmaLan.c: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 id[4];
data/libkarma-0.1.2/src/karmaLan.c:506: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(id, &file_id, sizeof(file_id));
data/libkarma-0.1.2/src/karmaLan.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 id[4];
data/libkarma-0.1.2/src/karmaLan.c:529: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(id, &storage_id, sizeof(storage_id));
data/libkarma-0.1.2/src/karmaLan.c:561: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(d, &size, sizeof(size));
data/libkarma-0.1.2/src/karmaLan.c:563: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(&d[8], data, size);
data/libkarma-0.1.2/src/karmaUsb.c:156:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static char buf[512];
data/libkarma-0.1.2/src/karmaUsb.c:160: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/libkarma-0.1.2/src/karmaUsb.c:166:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fd = open(path, O_RDONLY);
data/libkarma-0.1.2/src/karmaUsb.c: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 buf[BUFSIZ] = "";
data/libkarma-0.1.2/src/karmaUsb.c:355: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 realFile[1024], fidLine[32], *aux;
data/libkarma-0.1.2/src/karmaUsb.c:362: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(realFile, path, len);
data/libkarma-0.1.2/src/karmaUsb.c:365: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(realFile+len, fname, k+1);
data/libkarma-0.1.2/src/karmaUsb.c:369: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).
    oneFile = open(realFile, O_RDONLY);
data/libkarma-0.1.2/src/karmaUsb.c:391:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(fidLine, "fid=%d\n", fid);
data/libkarma-0.1.2/src/karmaUsb.c:406:20:  [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).
        zeroFile = open(realFile, O_RDONLY);
data/libkarma-0.1.2/src/karmaUsb.c:428: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(*properties + *offset, str, got);
data/libkarma-0.1.2/src/karmaUsb.c:447: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 path1[1024] = "", path[1024] = "";
data/libkarma-0.1.2/src/karmaUsb.c:451: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(path1, "/fids0/");
data/libkarma-0.1.2/src/karmaUsb.c:505: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[BUFSIZ] = "";
data/libkarma-0.1.2/src/karmaUsb.c:527:26:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        fid = (uint32_t) atol(prop + 4);
data/libkarma-0.1.2/src/karmaUsb.c:598: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(prop, buf, len);
data/libkarma-0.1.2/src/karmaUsb.c:612:11:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    fid = atoi(&props[4]);
data/libkarma-0.1.2/src/karmaUsb.c:638:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fp = fopen(tmp, "rb");
data/libkarma-0.1.2/src/karmaUsb.c:745: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(ptr, prop_strs[i], tmpnum);
data/libkarma-0.1.2/src/karmaUsb.c:794: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(path, O_RDONLY);
data/libkarma-0.1.2/src/karmaUsb.c:838:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if((fd = open(path, O_WRONLY | O_CREAT, PERMS)) == EEXIST)
data/libkarma-0.1.2/src/karmaUsb.c:839:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fd = open(path, O_WRONLY | O_TRUNC, PERMS);
data/libkarma-0.1.2/src/karmaUsb.c:845:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        if((fd = open(path, O_WRONLY | O_CREAT, PERMS)) == EEXIST)
data/libkarma-0.1.2/src/karmaUsb.c:846:18:  [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(path, O_WRONLY | O_TRUNC, PERMS);
data/libkarma-0.1.2/src/karmaUsb.c:890: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(path, O_WRONLY | O_CREAT, PERMS);
data/libkarma-0.1.2/src/karmaUsb.c:898:18:  [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(path, O_WRONLY | O_CREAT, PERMS);
data/libkarma-0.1.2/src/md5.c:182: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( (void *) (ctx->buffer + left), (void *) input, fill );
data/libkarma-0.1.2/src/md5.c:196: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( (void *) (ctx->buffer + left), (void *) input, length );
data/libkarma-0.1.2/src/mountSearch.c:32: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(filename, "rb");
data/libkarma-0.1.2/src/mp3.c:123:21:  [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(&(mp3->header),&h2,sizeof(mp3header));
data/libkarma-0.1.2/src/mp3.c:144: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 buffer[FRAME_HEADER_SIZE];
data/libkarma-0.1.2/src/mp3.c:198: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 fbuf[4];
data/libkarma-0.1.2/src/mp3.c:267: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[129];
data/libkarma-0.1.2/src/mp3.c:269:5:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
    strcpy(buf,"TAG");
data/libkarma-0.1.2/src/mp3.h:40: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 title[31];
data/libkarma-0.1.2/src/mp3.h:41: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 artist[31];
data/libkarma-0.1.2/src/mp3.h:42:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char album[31];
data/libkarma-0.1.2/src/mp3.h:43: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 year[5];
data/libkarma-0.1.2/src/mp3.h:44: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 comment[31];
data/libkarma-0.1.2/src/mp3.h:45: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 track[1];
data/libkarma-0.1.2/src/mp3.h:46: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 genre[1];
data/libkarma-0.1.2/src/playlist.c:116: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(pl->playlist, &head, 4);
data/libkarma-0.1.2/src/playlist.c:227: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(fid, &pl->playlist[4+n*8], 4);
data/libkarma-0.1.2/src/playlist.c:228: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(fid_generation, &pl->playlist[8+n*8], 4);
data/libkarma-0.1.2/src/playlist.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(&pl->playlist[4+n*8], &fid, 4);
data/libkarma-0.1.2/src/playlist.c:242: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(&pl->playlist[8+n*8], &fid, 4);
data/libkarma-0.1.2/src/playlist.c:253: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(&pl->playlist[pl->length-8], &fid, 4);
data/libkarma-0.1.2/src/playlist.c:255: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(&pl->playlist[pl->length-4], &fid_generation, 4);
data/libkarma-0.1.2/src/properties.c:116:28:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            fid=(uint32_t)(atol(lk_properties_get_property_hash(item,
data/libkarma-0.1.2/src/properties.c:288: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).
    fd=open(fname,O_RDONLY);
data/libkarma-0.1.2/src/properties.c:340: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).
    fd=open(fname,O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR|S_IWUSR);
data/libkarma-0.1.2/src/properties.c:455: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(result, search_in, (i) * sizeof(uint32_t));
data/libkarma-0.1.2/src/properties.c:531: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(*arr+off, str, sz);
data/libkarma-0.1.2/src/properties.c:621:29:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                offset[i] = atoi(str);
data/libkarma-0.1.2/src/properties.c:632:32:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                offset_16[i] = atoi(str);
data/libkarma-0.1.2/src/properties.c:643:31:  [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).
                offset_c[i] = atoi(str);
data/libkarma-0.1.2/src/properties.c:686: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(db->attribs[i].name, optr, len);
data/libkarma-0.1.2/src/properties.c:727:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fp = fopen(tmp, "w+");
data/libkarma-0.1.2/src/properties.c:730:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fp = fopen(tmp, "w+");
data/libkarma-0.1.2/src/rio_rw.c:76:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    dst=open(filename,
data/libkarma-0.1.2/src/rio_rw.c:99:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    dst=open(filename,
data/libkarma-0.1.2/src/rio_rw.c:148:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    rid_fd = open(filename, O_RDONLY);
data/libkarma-0.1.2/src/rio_rw.c:210: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(filename, "/lkarmaXXXXXX");
data/libkarma-0.1.2/src/rio_rw.c:212:10:  [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).
    fd = mkstemp(filename); /* filename X's are replaced with a unique string */
data/libkarma-0.1.2/src/rio_rw.c:226: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(filename, O_WRONLY);
data/libkarma-0.1.2/src/rio_rw.c:323: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 *p, tmp[BLOCKSIZE];
data/libkarma-0.1.2/src/rio_rw.c:325: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 *rid, *path, fullpath[257+PATH_MAX];
data/libkarma-0.1.2/src/rio_rw.c:327: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).
    fd=open(filename, O_RDONLY);
data/libkarma-0.1.2/src/rio_rw.c:460: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 bitrate[5];
data/libkarma-0.1.2/src/rio_rw.c:477:9:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
        strcpy(bitrate, "fs");
data/libkarma-0.1.2/src/rio_rw.c:560: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 bitrate[6];
data/libkarma-0.1.2/src/rio_rw.c:565:18:  [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).
    fdTestOpen = open(filename, O_RDONLY);
data/libkarma-0.1.2/src/rio_rw.c:631:5:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
    strcpy(bitrate, "vs");
data/libkarma-0.1.2/src/rio_rw.c:634:19:  [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.
        if(i>999) strcat(bitrate, "999");
data/libkarma-0.1.2/src/rio_rw.c:648: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[48];
data/libkarma-0.1.2/src/rio_rw.c:657:17:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    mp3->file = fopen(mp3->filename, "r");
data/libkarma-0.1.2/src/rio_rw.c:695:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(buf, buf+4, 4);
data/libkarma-0.1.2/src/ssdp.c:71:13:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    *port = atoi(pos1);
data/libkarma-0.1.2/src/ssdp.c:99: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 buffer[RESPONSE_BUFFER_LEN];
data/libkarma-0.1.2/src/util.c:51:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static char local[22];
data/libkarma-0.1.2/src/util.c:175: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.
    static unsigned char rid_output[33];
data/libkarma-0.1.2/src/util.c:178: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 cache[RID_BLOCKS];
data/libkarma-0.1.2/src/util.c:179: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 md5output[16], b_md5[16], c_md5[16];
data/libkarma-0.1.2/src/util.c:227: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(str, mountpoint, len);
data/libkarma-0.1.2/src/util.c:228: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(str+len, RK_SMALLDB, strlen(RK_SMALLDB)+1);
data/libkarma-0.1.2/src/util.c:234: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(str+len, "/fids0", strlen("/fids0")+1);
data/libkarma-0.1.2/src/wav.c:53:20:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if(-1==(filefd=open(filename, O_RDONLY)))
data/libkarma-0.1.2/src/wav.h:17: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            RiffID [4] ;
data/libkarma-0.1.2/src/wav.h:19: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            WaveID [4] ;
data/libkarma-0.1.2/src/wav.h:20: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            FmtID  [4] ;
data/libkarma-0.1.2/tools/karma_helper.c:34: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 dirname[64];
data/libkarma-0.1.2/tools/karma_helper.c:35: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 id[4];
data/libkarma-0.1.2/tools/karma_helper.c:49: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(dirname, RIO_DEV_DIR, dirlen);
data/libkarma-0.1.2/tools/karma_helper.c:50: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(dirname+dirlen, ent->d_name, devlen);
data/libkarma-0.1.2/tools/karma_helper.c:60: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(dirname+dirlen, ent2->d_name, strlen(ent2->d_name)+1);
data/libkarma-0.1.2/tools/karma_helper.c:61:22:  [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(dirname, O_RDONLY);
data/libkarma-0.1.2/tools/karma_helper.c:72: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(dirname+dirlen, ent2->d_name, strlen(ent2->d_name)+1);
data/libkarma-0.1.2/tools/karma_helper.c:73:22:  [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(dirname, O_RDONLY);
data/libkarma-0.1.2/tools/karma_helper.c:101: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(dev, ent->d_name, devlen);
data/libkarma-0.1.2/tools/karma_helper.c:102: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(dev+devlen, ":1.0", devlen+5);
data/libkarma-0.1.2/tools/karma_helper.c:145: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 request[40];
data/libkarma-0.1.2/tools/karma_helper.c:146: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 response[512];
data/libkarma-0.1.2/tools/karma_helper.c:193:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fd = open("/var/run/console/console.lock", O_RDONLY);
data/libkarma-0.1.2/tools/karma_helper.c:221:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fd = open(RIO_BIND, O_WRONLY);
data/libkarma-0.1.2/tools/karma_helper.c:232: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(bound, RIO_BIND, len);
data/libkarma-0.1.2/tools/karma_helper.c:233: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(bound+len, dev, strlen(dev)+1);
data/libkarma-0.1.2/tools/karma_helper.c:280: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(request+8, &sec, sizeof(sec));
data/libkarma-0.1.2/tools/pathedit.c:49:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static char buf[512], num[8];
data/libkarma-0.1.2/tools/pathedit.c:130: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 c, a[1024], b[1024], d[1024];
data/libkarma-0.1.2/tools/riocp.c:124: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 ourhostname[255], hostname[255], path[PATH_MAX];
data/libkarma-0.1.2/tools/riocp.c:140: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(hostname, filename, 255);
data/libkarma-0.1.2/tools/riocp.c:147: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(path, p+1, PATH_MAX);
data/libkarma-0.1.2/tools/riocp.c:222: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(vp, vc, (sizec+1)*sizeof(uint32_t));     /* copy vp=vc */
data/libkarma-0.1.2/tools/riocp.c:294: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((a)+pos, s, len); \
data/libkarma-0.1.2/tools/riocp.c:334:21:  [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(filename+pos, useProps+i, 1);
data/libkarma-0.1.2/tools/riocp.c:348:25:  [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(filename+pos, useProps+i, 1);
data/libkarma-0.1.2/src/fdb.c:61:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int read,upd,size=0;
data/libkarma-0.1.2/src/fdb.c:97:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        size+=read;
data/libkarma-0.1.2/src/fdb.c:98:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    }while(read > 0);    
data/libkarma-0.1.2/src/fdb.c:103:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        return read;
data/libkarma-0.1.2/src/fdb.c:130:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int read,size=0;
data/libkarma-0.1.2/src/fdb.c:146:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        size+=read;
data/libkarma-0.1.2/src/fdb.c:147:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    }while(read > 0);    
data/libkarma-0.1.2/src/fdb.c:167: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).
        len=strlen(p)+1;
data/libkarma-0.1.2/src/fdb.c:195:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        gzwrite(fdb_file, id, strlen(id));
data/libkarma-0.1.2/src/fdb.c:220: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).
                                          strlen(FDB_FILENAME)+1) == 0)
data/libkarma-0.1.2/src/fdb.c:230: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).
            gzwrite(fdb_file, id, strlen(id));
data/libkarma-0.1.2/src/fdb.c:232: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).
            gzwrite(fdb_file, tm, strlen(tm));
data/libkarma-0.1.2/src/fdb.c:234: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).
            gzwrite(fdb_file, path, strlen(path));
data/libkarma-0.1.2/src/karma.c:304: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).
         str += strlen("device_generation") + 1;
data/libkarma-0.1.2/src/karma.c:311: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).
         str += strlen("serial") + 1;
data/libkarma-0.1.2/src/karmaLan.c:236:39:  [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).
    md5input=(unsigned char *)malloc((strlen(pass)+SALTLENGTH+1));
data/libkarma-0.1.2/src/karmaLan.c:238:41:  [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).
    memcpy(&md5input[SALTLENGTH], pass, strlen(pass));
data/libkarma-0.1.2/src/karmaLan.c:241: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).
    md5_update(&ctx, (uint8_t *)md5input, SALTLENGTH+strlen(pass));
data/libkarma-0.1.2/src/karmaLan.c:323: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).
    len=strlen(properties);
data/libkarma-0.1.2/src/karmaLan.c:440: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).
    rlen=strlen(properties);
data/libkarma-0.1.2/src/karmaUsb.c:59: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(usbMountPoint) + 17;
data/libkarma-0.1.2/src/karmaUsb.c:62: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(path);
data/libkarma-0.1.2/src/karmaUsb.c:76: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).
    int len = strlen(path);
data/libkarma-0.1.2/src/karmaUsb.c:84:9:  [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(usbMountPoint, "/");
data/libkarma-0.1.2/src/karmaUsb.c:163: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).
        ret = strlen(usbMountPoint);
data/libkarma-0.1.2/src/karmaUsb.c:164:9:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
        strncat(path, usbMountPoint, 1024);
data/libkarma-0.1.2/src/karmaUsb.c:165:9:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
        strncat(path+ret, DEVICE_SETTINGS_FILE, 1024-ret);
data/libkarma-0.1.2/src/karmaUsb.c:168:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            ret = read(fd, buf, 512);
data/libkarma-0.1.2/src/karmaUsb.c:316:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if(strlen(buf) == 0)
data/libkarma-0.1.2/src/karmaUsb.c:320: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).
            needed_size = strlen(buf) + 1;
data/libkarma-0.1.2/src/karmaUsb.c:328:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        needed_size = strlen(prop_strs[i]) + strlen(buf) + 1;
data/libkarma-0.1.2/src/karmaUsb.c:328: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).
        needed_size = strlen(prop_strs[i]) + strlen(buf) + 1;
data/libkarma-0.1.2/src/karmaUsb.c:360: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(path);
data/libkarma-0.1.2/src/karmaUsb.c:363: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).
        k = strlen(fname);
data/libkarma-0.1.2/src/karmaUsb.c:368:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    realFile[strlen(realFile) - 1] = '1';
data/libkarma-0.1.2/src/karmaUsb.c:386:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(fidLine, rindex(path, '_') + 1, 16);
data/libkarma-0.1.2/src/karmaUsb.c:387: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).
    fidLine[strlen(fidLine) - 1] = '\0';
data/libkarma-0.1.2/src/karmaUsb.c:388:5:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
    strncat(fidLine, fname, 16 - strlen(fidLine));
data/libkarma-0.1.2/src/karmaUsb.c:388: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).
    strncat(fidLine, fname, 16 - strlen(fidLine));
data/libkarma-0.1.2/src/karmaUsb.c:393: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).
    *offset += strlen(fidLine);
data/libkarma-0.1.2/src/karmaUsb.c:394:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    got = read(oneFile, *properties + *offset, len);
data/libkarma-0.1.2/src/karmaUsb.c:405: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).
        realFile[strlen(realFile) - 1] = '0';
data/libkarma-0.1.2/src/karmaUsb.c:416: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).
        len = 4 * statbuf.st_size + strlen("playlist=\n");
data/libkarma-0.1.2/src/karmaUsb.c:422:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
        strncpy(*properties + *offset, "playlist=", len);
data/libkarma-0.1.2/src/karmaUsb.c:423:20:  [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).
        *offset += strlen("playlist=");
data/libkarma-0.1.2/src/karmaUsb.c:424:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        got = read(zeroFile, (*properties + *offset), len);
data/libkarma-0.1.2/src/karmaUsb.c:427: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).
        got = strlen(str);
data/libkarma-0.1.2/src/karmaUsb.c:450:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(path1, usbMountPoint, 1023 - strlen("/fids0/_00000/100"));
data/libkarma-0.1.2/src/karmaUsb.c:450:42:  [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).
    strncpy(path1, usbMountPoint, 1023 - strlen("/fids0/_00000/100"));
data/libkarma-0.1.2/src/karmaUsb.c:467:9:  [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(path, "/");
data/libkarma-0.1.2/src/karmaUsb.c:475: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).
               de->d_name[strlen(de->d_name) - 1] == '0') {
data/libkarma-0.1.2/src/karmaUsb.c:544: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).
                ptr += strlen(str) + 1;
data/libkarma-0.1.2/src/karmaUsb.c:586: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).
        len = strlen(buf);
data/libkarma-0.1.2/src/karmaUsb.c:633: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).
    tmp = calloc(strlen(usbMountPoint) + strlen(RK_SMALLDB) + 1, 1);
data/libkarma-0.1.2/src/karmaUsb.c:633:42:  [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).
    tmp = calloc(strlen(usbMountPoint) + strlen(RK_SMALLDB) + 1, 1);
data/libkarma-0.1.2/src/karmaUsb.c:744:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            tmpnum = strlen(prop_strs[i]);
data/libkarma-0.1.2/src/karmaUsb.c:886: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).
    path[strlen(path) - 1] = '1';
data/libkarma-0.1.2/src/karmaUsb.c:893: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).
        res = strlen(path);
data/libkarma-0.1.2/src/karmaUsb.c:909: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(properties);
data/libkarma-0.1.2/src/karmaUsb.c:933: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).
    path[strlen(path) - 1] = '1';
data/libkarma-0.1.2/src/mp3.c:108:18:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while((c=fgetc(mp3->file)) != 255 && (c != EOF));
data/libkarma-0.1.2/src/mp3.c:241:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    l=strlen(string);
data/libkarma-0.1.2/src/mp3.c:254:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    char *pos=string+strlen(string)-1;
data/libkarma-0.1.2/src/mp3.c:280:5:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
    strncat(buf,(char*)mp3->id3.genre,1);
data/libkarma-0.1.2/src/playlist.c:57: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).
    end=&((str)[strlen(str)]);
data/libkarma-0.1.2/src/properties.c:87:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    last=&(properties[strlen(properties)])+1; 
data/libkarma-0.1.2/src/properties.c:105:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if(strlen(ivalue))
data/libkarma-0.1.2/src/properties.c:156: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).
    len+=strlen(key)+strlen((char *)data)+6; \
data/libkarma-0.1.2/src/properties.c:156:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len+=strlen(key)+strlen((char *)data)+6; \
data/libkarma-0.1.2/src/properties.c:159:5:  [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(p, "="); \
data/libkarma-0.1.2/src/properties.c:161:5:  [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(p, "\n"); \
data/libkarma-0.1.2/src/properties.c:296:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read(fd, buf, info.st_size);
data/libkarma-0.1.2/src/properties.c:350: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).
            write(fd, buf, strlen(buf));
data/libkarma-0.1.2/src/properties.c:524:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                sz = strlen(str)+1;
data/libkarma-0.1.2/src/properties.c:722: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).
    tmp = calloc(strlen(usbMountPoint) + strlen(RK_SMALLDB) + 1, 1);
data/libkarma-0.1.2/src/properties.c:722:42:  [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).
    tmp = calloc(strlen(usbMountPoint) + strlen(RK_SMALLDB) + 1, 1);
data/libkarma-0.1.2/src/properties.c:761: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).
        len += strlen(atb->name) + 1;
data/libkarma-0.1.2/src/properties.c:766:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        fwrite(name, strlen(name), 1, fp);
data/libkarma-0.1.2/src/rio_rw.c:207: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(karma_tmpdir) + strlen("/lkarmaXXXXXX");
data/libkarma-0.1.2/src/rio_rw.c:207: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).
    len = strlen(karma_tmpdir) + strlen("/lkarmaXXXXXX");
data/libkarma-0.1.2/src/rio_rw.c:364:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while((got=read(fd, &tmp, siz)) > 0) {  /* Now writing the data */
data/libkarma-0.1.2/src/rio_rw.c:377: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).
        len = strlen(fullpath);
data/libkarma-0.1.2/src/rio_rw.c:545: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).
    n = strlen(s) - 1;
data/libkarma-0.1.2/src/ssdp.c:117: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).
    ret = sendto(sock, data, strlen(data), 0, (struct sockaddr *)&sockname,
data/libkarma-0.1.2/src/ssdp.c:119: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).
    if(ret != strlen(data)) {
data/libkarma-0.1.2/src/utf8.c:61:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    insz = strlen(auxdata);
data/libkarma-0.1.2/src/utf8.c:73: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).
    ivalue = realloc(ivalue, strlen(ivalue)+1);
data/libkarma-0.1.2/src/utf8.c:86:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    insz = strlen(auxdata);
data/libkarma-0.1.2/src/utf8.c:98: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).
    ivalue = realloc(ivalue, strlen(ivalue)+1);
data/libkarma-0.1.2/src/util.c:68: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).
    len=strlen(home)+24+strlen(file)+1;
data/libkarma-0.1.2/src/util.c:68: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(home)+24+strlen(file)+1;
data/libkarma-0.1.2/src/util.c:184:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    size=read(file, &cache, RID_BLOCKS);
data/libkarma-0.1.2/src/util.c:194:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        read(file, &cache, RID_BLOCKS);
data/libkarma-0.1.2/src/util.c:199:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        size=read(file, &cache, RID_BLOCKS);
data/libkarma-0.1.2/src/util.c:223: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(mountpoint);
data/libkarma-0.1.2/src/util.c:224:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    str = malloc(len+strlen(RK_SMALLDB)+1);
data/libkarma-0.1.2/src/util.c:228:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    memcpy(str+len, RK_SMALLDB, strlen(RK_SMALLDB)+1);
data/libkarma-0.1.2/src/util.c:234:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    memcpy(str+len, "/fids0", strlen("/fids0")+1);
data/libkarma-0.1.2/src/wav.c:56:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if(read(filefd, *wh, sizeof(wave_header)) != (ssize_t) sizeof(wave_header)){
data/libkarma-0.1.2/tools/ftw.c:41: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).
    cdl=strlen(cd);
data/libkarma-0.1.2/tools/ftw.c:50:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        nl=strlen(de->d_name);
data/libkarma-0.1.2/tools/karma_helper.c:47: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).
        dirlen = strlen(RIO_DEV_DIR);
data/libkarma-0.1.2/tools/karma_helper.c:48: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).
        devlen = strlen(ent->d_name);
data/libkarma-0.1.2/tools/karma_helper.c:60: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).
                memcpy(dirname+dirlen, ent2->d_name, strlen(ent2->d_name)+1);
data/libkarma-0.1.2/tools/karma_helper.c:64:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                read(fd, id, 4);
data/libkarma-0.1.2/tools/karma_helper.c:72: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).
                memcpy(dirname+dirlen, ent2->d_name, strlen(ent2->d_name)+1);
data/libkarma-0.1.2/tools/karma_helper.c:76:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                read(fd, id, 4);
data/libkarma-0.1.2/tools/karma_helper.c:199:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ret = read(fd, name, 64);
data/libkarma-0.1.2/tools/karma_helper.c:231: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).
        len = strlen(RIO_BIND)-4;
data/libkarma-0.1.2/tools/karma_helper.c:233:32:  [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).
        memcpy(bound+len, dev, strlen(dev)+1);
data/libkarma-0.1.2/tools/karma_helper.c:236: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).
            len = write(fd, dev, strlen(dev));
data/libkarma-0.1.2/tools/karma_helper.c:238:13:  [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(10);
data/libkarma-0.1.2/tools/karma_helper.c:299:13:  [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(10);
data/libkarma-0.1.2/tools/pathedit.c:140: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).
    s1 = strlen(a);
data/libkarma-0.1.2/tools/pathedit.c:141: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).
    s2 = strlen(b);
data/libkarma-0.1.2/tools/pathedit.c:161: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).
    if(del && (strlen(del)>0)) {
data/libkarma-0.1.2/tools/riocp.c:133: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).
        len = strlen(ourhostname) + 1;
data/libkarma-0.1.2/tools/riocp.c:291: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).
        s = ((b&&strlen(b))?b:unkName); \
data/libkarma-0.1.2/tools/riocp.c:292: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).
        len = strlen(s); \
data/libkarma-0.1.2/tools/riocp.c:633:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if(strlen(usercodeset = nl_langinfo(CODESET)) == 0) {

ANALYSIS SUMMARY:

Hits = 310
Lines analyzed = 8014 in approximately 0.31 seconds (25664 lines/second)
Physical Source Lines of Code (SLOC) = 6224
Hits@level = [0] 140 [1] 120 [2] 163 [3]   4 [4]  18 [5]   5
Hits@level+ = [0+] 450 [1+] 310 [2+] 190 [3+]  27 [4+]  23 [5+]   5
Hits/KSLOC@level+ = [0+] 72.3008 [1+] 49.8072 [2+] 30.527 [3+] 4.33805 [4+] 3.69537 [5+] 0.803342
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.