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/libdrpm-0.5.0/src/drpm.c
Examining data/libdrpm-0.5.0/src/drpm.h
Examining data/libdrpm-0.5.0/src/drpm_apply.c
Examining data/libdrpm-0.5.0/src/drpm_compstrm.c
Examining data/libdrpm-0.5.0/src/drpm_decompstrm.c
Examining data/libdrpm-0.5.0/src/drpm_deltarpm.c
Examining data/libdrpm-0.5.0/src/drpm_diff.c
Examining data/libdrpm-0.5.0/src/drpm_options.c
Examining data/libdrpm-0.5.0/src/drpm_private.h
Examining data/libdrpm-0.5.0/src/drpm_read.c
Examining data/libdrpm-0.5.0/src/drpm_rpm.c
Examining data/libdrpm-0.5.0/src/drpm_search.c
Examining data/libdrpm-0.5.0/src/drpm_utils.c
Examining data/libdrpm-0.5.0/src/drpm_write.c
Examining data/libdrpm-0.5.0/src/drpm_block.c
Examining data/libdrpm-0.5.0/src/drpm_make.c
Examining data/libdrpm-0.5.0/test/drpm_api_tests.c
Examining data/libdrpm-0.5.0/debian/tests/examine.c

FINAL RESULTS:

data/libdrpm-0.5.0/src/drpm.c:247: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(*ret, string);
data/libdrpm-0.5.0/src/drpm_apply.c:646:9:  [4] (shell) execl:
  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.
        execl("/usr/sbin/prelink", "prelink", "-o", template, "-u", filename, NULL);
data/libdrpm-0.5.0/src/drpm_block.c:530: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((char *)blks->cpio_buffer + CPIO_HEADER_SIZE, CPIO_TRAILER);
data/libdrpm-0.5.0/src/drpm_block.c:560: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((char *)blks->cpio_buffer + CPIO_HEADER_SIZE + 2, name);
data/libdrpm-0.5.0/src/drpm_make.c:247:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(buffer, CPIO_MAGIC
data/libdrpm-0.5.0/src/drpm_make.c:753:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(patch->nevr, "%s-%s", name, evr);
data/libdrpm-0.5.0/src/drpm_make.c:778:13:  [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(patch->files[patch->file_count].name, filename);
data/libdrpm-0.5.0/src/drpm_make.c:924:13:  [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(rpmprint->files[i].name, fname);
data/libdrpm-0.5.0/src/drpm_make.c:1050: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(delta->src_nevr, nevr);
data/libdrpm-0.5.0/src/drpm_make.c:1051: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(delta->head.tgt_nevr, nevr);
data/libdrpm-0.5.0/src/drpm_options.c:109: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(opts_dst->seqfile, opts_src->seqfile);
data/libdrpm-0.5.0/src/drpm_options.c:115: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(opts_dst->oldrpmprint, opts_src->oldrpmprint);
data/libdrpm-0.5.0/src/drpm_options.c:121: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(opts_dst->oldpatchrpm, opts_src->oldpatchrpm);
data/libdrpm-0.5.0/src/drpm_options.c:246: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(opts->seqfile, seqfile);
data/libdrpm-0.5.0/src/drpm_options.c:270: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(opts->oldrpmprint, oldrpmprint);
data/libdrpm-0.5.0/src/drpm_options.c:271: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(opts->oldpatchrpm, oldpatchrpm);
data/libdrpm-0.5.0/src/drpm_read.c:524: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(dst->filename, src->filename);
data/libdrpm-0.5.0/src/drpm_read.c:525: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(dst->src_nevr, src->src_nevr);
data/libdrpm-0.5.0/src/drpm_read.c:548: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(dst->tgt_nevr, src->head.tgt_nevr);
data/libdrpm-0.5.0/src/drpm_rpm.c:822: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(files[i].name, name);
data/libdrpm-0.5.0/src/drpm_rpm.c:824: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(files[i].md5, md5);
data/libdrpm-0.5.0/src/drpm_rpm.c:829: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(files[i].linkto, linkto);
data/libdrpm-0.5.0/src/drpm_rpm.c:1025: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(str, nevr);
data/libdrpm-0.5.0/src/drpm.c:430: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(old_cpio, old_header, old_header_len);
data/libdrpm-0.5.0/src/drpm.c:431: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(new_cpio, new_header, new_header_len);
data/libdrpm-0.5.0/src/drpm.c:506: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 oldsig_md5[MD5_DIGEST_LENGTH];
data/libdrpm-0.5.0/src/drpm.c:507: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 newsig_md5[MD5_DIGEST_LENGTH];
data/libdrpm-0.5.0/src/drpm.c:517: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 md5_digest[MD5_DIGEST_LENGTH];
data/libdrpm-0.5.0/src/drpm.c:520: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.
    const unsigned char empty_md5[MD5_DIGEST_LENGTH] = {0};
data/libdrpm-0.5.0/src/drpm.c:846: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 sigmd5[MD5_DIGEST_LENGTH];
data/libdrpm-0.5.0/src/drpm_apply.c:72: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 seq_md5_digest[MD5_DIGEST_LENGTH];
data/libdrpm-0.5.0/src/drpm_apply.c:73: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 digest[MAX(MD5_DIGEST_LENGTH, SHA256_DIGEST_LENGTH)];
data/libdrpm-0.5.0/src/drpm_apply.c:290: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[128];
data/libdrpm-0.5.0/src/drpm_apply.c:302:25:  [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 ((filedesc = open(filename, O_RDONLY)) < 0)
data/libdrpm-0.5.0/src/drpm_apply.c:327: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[BUFFER_SIZE];
data/libdrpm-0.5.0/src/drpm_apply.c:329: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 chsm_digest[MAX(MD5_DIGEST_LENGTH, SHA256_DIGEST_LENGTH)];
data/libdrpm-0.5.0/src/drpm_apply.c:334:21:  [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 ((filedesc = open(filename, O_RDONLY)) < 0)
data/libdrpm-0.5.0/src/drpm_apply.c:388: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[BUFFER_SIZE];
data/libdrpm-0.5.0/src/drpm_apply.c:390: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 chsm_digest[MAX(MD5_DIGEST_LENGTH, SHA256_DIGEST_LENGTH)];
data/libdrpm-0.5.0/src/drpm_apply.c:637:15:  [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(template)) < 0)
data/libdrpm-0.5.0/src/drpm_apply.c:652: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).
    if ((fd = open(template, O_RDONLY)) < 0)
data/libdrpm-0.5.0/src/drpm_block.c:285:47:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
int blocks_next(struct blocks *blks, unsigned char buffer[BLOCK_SIZE], size_t *buffer_len,
data/libdrpm-0.5.0/src/drpm_block.c:304: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(buffer, blks->last_block->data.buffer + blk_off, *buffer_len);
data/libdrpm-0.5.0/src/drpm_block.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(new->data.buffer, blk->data.buffer, BLOCK_SIZE);
data/libdrpm-0.5.0/src/drpm_block.c:482:40:  [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 ((blks->page_filedesc = mkstemp(template)) < 0) {
data/libdrpm-0.5.0/src/drpm_block.c:531: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(blks->cpio_buffer + CPIO_HEADER_SIZE + header.namesize,
data/libdrpm-0.5.0/src/drpm_block.c:559: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((char *)blks->cpio_buffer + CPIO_HEADER_SIZE, "./");
data/libdrpm-0.5.0/src/drpm_block.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(blks->cpio_buffer + CPIO_HEADER_SIZE + header.namesize,
data/libdrpm-0.5.0/src/drpm_block.c:573: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 plnk_buf[128];
data/libdrpm-0.5.0/src/drpm_block.c:586:21:  [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 ((filedesc = open(file.name, O_RDONLY)) < 0)
data/libdrpm-0.5.0/src/drpm_block.c:685: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 cpio_buf[CPIO_HEADER_SIZE] = {0};
data/libdrpm-0.5.0/src/drpm_block.c:713: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(buf_ptr, blks->cpio_buffer + off, read_len);
data/libdrpm-0.5.0/src/drpm_block.c:876: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(blk->data.buffer, header + header_offset, header_read_len);
data/libdrpm-0.5.0/src/drpm_block.c:955:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(buf_ptr, blks->cpio_buffer + file_off, read_len);
data/libdrpm-0.5.0/src/drpm_block.c:1027: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 plnk_buf[128];
data/libdrpm-0.5.0/src/drpm_block.c:1034: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 blk_buf[BLOCK_SIZE];
data/libdrpm-0.5.0/src/drpm_block.c:1048:25:  [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 ((filedesc = open(blks->files[cpio->index].name, O_RDONLY)) < 0) {
data/libdrpm-0.5.0/src/drpm_block.c:1097: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(buf_ptr, blks->cpio_buffer + file_off, read_len);
data/libdrpm-0.5.0/src/drpm_block.c:1116: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(buf_ptr, linkto + file_off, read_len);
data/libdrpm-0.5.0/src/drpm_block.c:1138:41:  [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 ((filedesc = open(blks->files[cpio->index].name, O_RDONLY)) < 0) {
data/libdrpm-0.5.0/src/drpm_block.c:1183: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(blk_buf, blk->data.buffer, BLOCK_SIZE);
data/libdrpm-0.5.0/src/drpm_block.c:1202: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(blk->data.buffer, blk_buf, BLOCK_SIZE);
data/libdrpm-0.5.0/src/drpm_compstrm.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 out_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_compstrm.c:125: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(strm->data + strm->data_len, out_buffer, out_len);
data/libdrpm-0.5.0/src/drpm_compstrm.c:139: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 out_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_compstrm.c:157: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(strm->data + strm->data_len, out_buffer, out_len);
data/libdrpm-0.5.0/src/drpm_compstrm.c:172: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 out_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_compstrm.c:200: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(strm->data + strm->data_len, out_buffer, out_len);
data/libdrpm-0.5.0/src/drpm_compstrm.c:216: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 out_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_compstrm.c:236: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(strm->data + strm->data_len, out_buffer, out_len);
data/libdrpm-0.5.0/src/drpm_compstrm.c:270: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(strm->data + strm->data_len, buffOut, output.pos);
data/libdrpm-0.5.0/src/drpm_compstrm.c:531: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(*data, strm->data, strm->data_len);
data/libdrpm-0.5.0/src/drpm_compstrm.c:540: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 bytes[4];
data/libdrpm-0.5.0/src/drpm_compstrm.c:552: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 bytes[8];
data/libdrpm-0.5.0/src/drpm_compstrm.c:604: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(strm->data + strm->data_len, in_buffer, in_len);
data/libdrpm-0.5.0/src/drpm_compstrm.c:613: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 out_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_compstrm.c:629: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(strm->data + strm->data_len, out_buffer, out_len);
data/libdrpm-0.5.0/src/drpm_compstrm.c:639: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 out_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_compstrm.c:655: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(strm->data + strm->data_len, out_buffer, out_len);
data/libdrpm-0.5.0/src/drpm_compstrm.c:665: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 out_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_compstrm.c:688: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(strm->data + strm->data_len, out_buffer, out_len);
data/libdrpm-0.5.0/src/drpm_compstrm.c:700: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 out_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_compstrm.c:726: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(strm->data + strm->data_len, out_buffer, out_len);
data/libdrpm-0.5.0/src/drpm_compstrm.c:755: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(strm->data + strm->data_len, buffOut, output.pos);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:358: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 bytes[4];
data/libdrpm-0.5.0/src/drpm_decompstrm.c:374: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 bytes[8];
data/libdrpm-0.5.0/src/drpm_decompstrm.c:403: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(buffer_ret, strm->data + strm->data_pos, read_len);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:442:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(*buffer_ret, strm->data + strm->data_pos, *len_ret);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:457: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[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_decompstrm.c:461: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(buffer, strm->buffer, in_len);
data/libdrpm-0.5.0/src/drpm_decompstrm.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(strm->data + strm->data_len, buffer, in_len);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:491: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 in_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_decompstrm.c:492: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 out_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_decompstrm.c:497: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(in_buffer, strm->buffer, in_len);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:528: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(strm->data + strm->data_len, out_buffer, out_len);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:544: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 in_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_decompstrm.c:545: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 out_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_decompstrm.c:550: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(in_buffer, strm->buffer, in_len);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:582: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(strm->data + strm->data_len, out_buffer, out_len);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:598: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 in_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_decompstrm.c:599: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 out_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_decompstrm.c:604: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(in_buffer, strm->buffer, in_len);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:642: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(strm->data + strm->data_len, out_buffer, out_len);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:660: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 in_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_decompstrm.c:661: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 out_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_decompstrm.c:672: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(in_buffer, strm->buffer, in_len);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:694: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(strm->data + strm->data_len, out_buffer, out_len);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:718: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(strm->data + strm->data_len, out_buffer, out_len);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:737: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 in_buffer[CHUNK_SIZE];
data/libdrpm-0.5.0/src/drpm_decompstrm.c:741: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(in_buffer, strm->buffer, in_len);
data/libdrpm-0.5.0/src/drpm_decompstrm.c:769: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(strm->data + strm->data_len, buffOut, output.pos);
data/libdrpm-0.5.0/src/drpm_diff.c:115: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[BUFFER_SIZE];
data/libdrpm-0.5.0/src/drpm_make.c:75: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 md5[MD5_DIGEST_LENGTH];
data/libdrpm-0.5.0/src/drpm_make.c:189: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(*cpio + old_cpio_len, seq, len);
data/libdrpm-0.5.0/src/drpm_make.c:197:28:  [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 buffer[CPIO_HEADER_SIZE + 1])
data/libdrpm-0.5.0/src/drpm_make.c:245:24:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                       char buffer[CPIO_HEADER_SIZE + 1])
data/libdrpm-0.5.0/src/drpm_make.c:280: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 digest[MAX(MD5_DIGEST_LENGTH, SHA256_DIGEST_LENGTH)] = {0};
data/libdrpm-0.5.0/src/drpm_make.c:287: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 cpio_buffer[CPIO_HEADER_SIZE + 1];
data/libdrpm-0.5.0/src/drpm_make.c:306: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 seq_md5_digest[MD5_DIGEST_LENGTH];
data/libdrpm-0.5.0/src/drpm_make.c:314: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[BUFFER_SIZE];
data/libdrpm-0.5.0/src/drpm_make.c:585: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(sequence, seq_md5_digest, MD5_DIGEST_LENGTH);
data/libdrpm-0.5.0/src/drpm_make.c:586: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(sequence + MD5_DIGEST_LENGTH, seq_files, seq_files_len);
data/libdrpm-0.5.0/src/drpm_make.c:623: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[2];
data/libdrpm-0.5.0/src/drpm_make.c:636: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];
data/libdrpm-0.5.0/src/drpm_make.c:734: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];
data/libdrpm-0.5.0/src/drpm_make.c:887:21:  [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 ((filedesc = open(oldpatchrpm, O_RDONLY)) < 0) {
data/libdrpm-0.5.0/src/drpm_make.c:897:21:  [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 ((filedesc = open(oldrpmprint, O_RDONLY)) < 0) {
data/libdrpm-0.5.0/src/drpm_make.c:988:60:  [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.
bool is_unpatched(const struct rpm_patches *patches, const char *name,
data/libdrpm-0.5.0/src/drpm_make.c:989:25:  [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 rpm_md5[MD5_DIGEST_LENGTH * 2 + 1])
data/libdrpm-0.5.0/src/drpm_make.c:992: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 patch_md5[MD5_DIGEST_LENGTH * 2 + 1];
data/libdrpm-0.5.0/src/drpm_private.h:76: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 tgt_md5[MD5_DIGEST_LENGTH * 2 + 1];
data/libdrpm-0.5.0/src/drpm_private.h:293: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 tgt_md5[MD5_DIGEST_LENGTH];
data/libdrpm-0.5.0/src/drpm_read.c: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 buffer[4];
data/libdrpm-0.5.0/src/drpm_read.c:64: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[8];
data/libdrpm-0.5.0/src/drpm_read.c:442:21:  [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 ((filedesc = open(filename, O_RDONLY)) == -1)
data/libdrpm-0.5.0/src/drpm_read.c:534: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(dst->offadj_elems, src->offadj_elems, dst->offadj_elems_size * 4);
data/libdrpm-0.5.0/src/drpm_read.c:536: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(dst->int_copies, src->int_copies, dst->int_copies_size * 4);
data/libdrpm-0.5.0/src/drpm_read.c:538: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(dst->ext_copies, src->ext_copies, dst->ext_copies_size * 4);
data/libdrpm-0.5.0/src/drpm_rpm.c:44:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char lead[RPMLEAD_SIZE];
data/libdrpm-0.5.0/src/drpm_rpm.c:92: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 padding[7] = {0};
data/libdrpm-0.5.0/src/drpm_rpm.c:112: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(*signature_ret, rpm_header_magic, sizeof(rpm_header_magic));
data/libdrpm-0.5.0/src/drpm_rpm.c:113: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(*signature_ret + sizeof(rpm_header_magic), signature, signature_size);
data/libdrpm-0.5.0/src/drpm_rpm.c:114: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(*signature_ret + sizeof(rpm_header_magic) + signature_size, padding, padding_bytes);
data/libdrpm-0.5.0/src/drpm_rpm.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(*header_ret, rpm_header_magic, sizeof(rpm_header_magic));
data/libdrpm-0.5.0/src/drpm_rpm.c:138: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(*header_ret + sizeof(rpm_header_magic), header, header_size);
data/libdrpm-0.5.0/src/drpm_rpm.c:184: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[BUFFER_SIZE];
data/libdrpm-0.5.0/src/drpm_rpm.c:189:21:  [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 ((filedesc = open(filename, O_RDONLY)) < 0)
data/libdrpm-0.5.0/src/drpm_rpm.c:219: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(rpmst->archive + rpmst->archive_size, buffer, bytes_read);
data/libdrpm-0.5.0/src/drpm_rpm.c:245:40:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
int rpm_read(struct rpm **rpmst, const char *filename,
data/libdrpm-0.5.0/src/drpm_rpm.c:247:23:  [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 seq_md5_digest[MD5_DIGEST_LENGTH],
data/libdrpm-0.5.0/src/drpm_rpm.c:248:23:  [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 full_md5_digest[MD5_DIGEST_LENGTH])
data/libdrpm-0.5.0/src/drpm_rpm.c:251: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.
    const unsigned char magic_rpm[4] = {0xED, 0xAB, 0xEE, 0xDB};
data/libdrpm-0.5.0/src/drpm_rpm.c:378: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(buffer, rpmst->archive + rpmst->archive_offset, count);
data/libdrpm-0.5.0/src/drpm_rpm.c:441: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(*lead_sig, rpmst->lead, RPMLEAD_SIZE);
data/libdrpm-0.5.0/src/drpm_rpm.c:442: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(*lead_sig + RPMLEAD_SIZE, signature, signature_size);
data/libdrpm-0.5.0/src/drpm_rpm.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(*archive_ret, rpmst->archive, rpmst->archive_size);
data/libdrpm-0.5.0/src/drpm_rpm.c:485:40:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
int rpm_write(struct rpm *rpmst, const char *filename, bool include_archive, unsigned char digest[MD5_DIGEST_LENGTH], bool full_md5)
data/libdrpm-0.5.0/src/drpm_rpm.c:485:87:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
int rpm_write(struct rpm *rpmst, const char *filename, bool include_archive, unsigned char digest[MD5_DIGEST_LENGTH], bool full_md5)
data/libdrpm-0.5.0/src/drpm_rpm.c:560: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(rpmst->lead, leadsig, RPMLEAD_SIZE);
data/libdrpm-0.5.0/src/drpm_rpm.c:634:14:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    *level = atoi(payload_flags);
data/libdrpm-0.5.0/src/drpm_rpm.c:944:55:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
int rpm_signature_set_md5(struct rpm *rpmst, unsigned char md5[MD5_DIGEST_LENGTH])
data/libdrpm-0.5.0/src/drpm_rpm.c:974:55:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
int rpm_signature_get_md5(struct rpm *rpmst, unsigned char md5[MD5_DIGEST_LENGTH], bool *has_md5)
data/libdrpm-0.5.0/src/drpm_rpm.c:990: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(md5, tag_data->data, MD5_DIGEST_LENGTH);
data/libdrpm-0.5.0/src/drpm_search.c:468: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((*suf)->F, F, sizeof(size_t) * 257);
data/libdrpm-0.5.0/src/drpm_utils.c:37:36:  [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.
uint16_t parse_be16(const unsigned char buffer[2])
data/libdrpm-0.5.0/src/drpm_utils.c:43:36:  [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.
uint32_t parse_be32(const unsigned char buffer[4])
data/libdrpm-0.5.0/src/drpm_utils.c:52:36:  [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.
uint64_t parse_be64(const unsigned char buffer[8])
data/libdrpm-0.5.0/src/drpm_utils.c:65:40:  [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.
void create_be32(uint32_t in, unsigned char out[4])
data/libdrpm-0.5.0/src/drpm_utils.c:74:40:  [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.
void create_be64(uint64_t in, unsigned char out[8])
data/libdrpm-0.5.0/src/drpm_utils.c:88: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 be32[4];
data/libdrpm-0.5.0/src/drpm_write.c:42: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 nbo[4];
data/libdrpm-0.5.0/src/drpm_write.c:55: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 nbo[8];
data/libdrpm-0.5.0/src/drpm_write.c:73: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 version[5];
data/libdrpm-0.5.0/src/drpm_write.c:80: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 md5_digest[MD5_DIGEST_LENGTH] = {0};
data/libdrpm-0.5.0/src/drpm_write.c:226:25:  [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 ((filedesc = open(delta->filename, O_WRONLY | O_APPEND)) < 0)
data/libdrpm-0.5.0/src/drpm_write.c:279:17:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((file = fopen(filename, "w")) == NULL)
data/libdrpm-0.5.0/src/drpm_write.c:358: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(csw->uncomp_data + csw->uncomp_len - csw->uncomp_left, buffer, write_len);
data/libdrpm-0.5.0/src/drpm_write.c:384:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(data_tmp, csw->uncomp_data, csw->uncomp_len);
data/libdrpm-0.5.0/test/drpm_api_tests.c:66: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 *filenames[DELTARPM_COUNT];
data/libdrpm-0.5.0/test/drpm_api_tests.c:67: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 *src_nevrs[DELTARPM_COUNT];
data/libdrpm-0.5.0/test/drpm_api_tests.c:68: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 *tgt_nevrs[DELTARPM_COUNT];
data/libdrpm-0.5.0/test/drpm_api_tests.c:69: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 *sequences[DELTARPM_COUNT];
data/libdrpm-0.5.0/test/drpm_api_tests.c:70: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 *tgt_md5s[DELTARPM_COUNT];
data/libdrpm-0.5.0/test/drpm_api_tests.c:71: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 *tgt_leads[DELTARPM_COUNT];
data/libdrpm-0.5.0/test/drpm_api_tests.c:924:17:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((file = fopen(SEQFILE, "r")) == NULL)
data/libdrpm-0.5.0/src/drpm.c:245: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).
        if ((*ret = malloc(strlen(string) + 1)) == NULL)
data/libdrpm-0.5.0/src/drpm.c:867: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).
    seq_len = (strlen(++ptr)) / 2;
data/libdrpm-0.5.0/src/drpm.c:877:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(nevr, sequence, nevr_len);
data/libdrpm-0.5.0/src/drpm_apply.c:182: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).
            filesize = strlen(files[i].linkto);
data/libdrpm-0.5.0/src/drpm_apply.c:195: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 (MD5_Update(&seq_md5, filename, strlen(filename) + 1) != 1 ||
data/libdrpm-0.5.0/src/drpm_apply.c:204:55:  [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 (MD5_Update(&seq_md5, files[i].linkto, strlen(files[i].linkto) + 1) != 1) {
data/libdrpm-0.5.0/src/drpm_apply.c:238: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).
            header_len = CPIO_HEADER_SIZE + strlen(filename) + 3; // "./" prefix
data/libdrpm-0.5.0/src/drpm_apply.c:261: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).
        header_len = CPIO_HEADER_SIZE + strlen(CPIO_TRAILER) + 1;
data/libdrpm-0.5.0/src/drpm_apply.c:304:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if ((read_len = read(filedesc, buf, 128)) > 0) {
data/libdrpm-0.5.0/src/drpm_apply.c:346:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if ((read_len = read(filedesc, buf, BUFFER_SIZE)) > 0) {
data/libdrpm-0.5.0/src/drpm_apply.c:361:40:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (filesize > 0 && (read_len = read(filedesc, buf, BUFFER_SIZE)) > 0) {
data/libdrpm-0.5.0/src/drpm_apply.c:399:40:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (filesize > 0 && (read_len = read(filedesc, buf, BUFFER_SIZE)) > 0) {
data/libdrpm-0.5.0/src/drpm_block.c:209: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).
    max_cpio_header_len = CPIO_HEADER_SIZE + strlen(CPIO_TRAILER) + 1;
data/libdrpm-0.5.0/src/drpm_block.c:528: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).
        header.namesize = strlen(CPIO_TRAILER) + 1;
data/libdrpm-0.5.0/src/drpm_block.c:545: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).
        header.filesize = strlen(file.linkto);
data/libdrpm-0.5.0/src/drpm_block.c:556: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).
    header.namesize = strlen(name) + 3; // "./" prefix
data/libdrpm-0.5.0/src/drpm_block.c:721:21:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                    strncpy((char *)buf_ptr, blks->linkto, read_len);
data/libdrpm-0.5.0/src/drpm_block.c:722: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).
                    blks->linkto += MIN(strlen(blks->linkto), read_len);
data/libdrpm-0.5.0/src/drpm_block.c:973: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).
                if (file_off > strlen(blks->linkto))
data/libdrpm-0.5.0/src/drpm_block.c:976:21:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                    strncpy((char *)buf_ptr, blks->linkto + file_off, read_len);
data/libdrpm-0.5.0/src/drpm_block.c:993:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                if (read(file->filedesc, buf_ptr, read_len) != (ssize_t)read_len) {
data/libdrpm-0.5.0/src/drpm_block.c:1114: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).
                read_len = MIN(len, strlen(linkto) < file_off ? 0 : strlen(linkto));
data/libdrpm-0.5.0/src/drpm_block.c:1114:69:  [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).
                read_len = MIN(len, strlen(linkto) < file_off ? 0 : strlen(linkto));
data/libdrpm-0.5.0/src/drpm_block.c:1153:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                    if (read(filedesc, buf_ptr, read_len) != (ssize_t)read_len) {
data/libdrpm-0.5.0/src/drpm_decompstrm.c:465:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if ((in_len = read(strm->filedesc, buffer, CHUNK_SIZE)) < 0)
data/libdrpm-0.5.0/src/drpm_decompstrm.c:501:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if ((in_len = read(strm->filedesc, in_buffer, CHUNK_SIZE)) < 0)
data/libdrpm-0.5.0/src/drpm_decompstrm.c:554:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if ((in_len = read(strm->filedesc, in_buffer, CHUNK_SIZE)) < 0)
data/libdrpm-0.5.0/src/drpm_decompstrm.c:608:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if ((in_len = read(strm->filedesc, in_buffer, CHUNK_SIZE)) < 0)
data/libdrpm-0.5.0/src/drpm_decompstrm.c:676:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if ((in_len = read(strm->filedesc, in_buffer, CHUNK_SIZE)) < 0)
data/libdrpm-0.5.0/src/drpm_decompstrm.c:745:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if ((in_len = read(strm->filedesc, in_buffer, CHUNK_SIZE)) < 0)
data/libdrpm-0.5.0/src/drpm_make.c:376: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).
        name_len = strlen(name) + 1;
data/libdrpm-0.5.0/src/drpm_make.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).
                cpio_hdr.filesize = strlen(file.linkto);
data/libdrpm-0.5.0/src/drpm_make.c:560: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).
    cpio_hdr.namesize = strlen(CPIO_TRAILER) + 1;
data/libdrpm-0.5.0/src/drpm_make.c:625:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(filedesc, buf, 2) != 2)
data/libdrpm-0.5.0/src/drpm_make.c:638:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(filedesc, buf, 4) != 4)
data/libdrpm-0.5.0/src/drpm_make.c:651:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(filedesc, &len, 1) != 1)
data/libdrpm-0.5.0/src/drpm_make.c:657:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (read(filedesc, *ret, len) != len) {
data/libdrpm-0.5.0/src/drpm_make.c:683:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(filedesc, buf, 2) != 2)
data/libdrpm-0.5.0/src/drpm_make.c:703:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(filedesc, filename + off, len) != len)
data/libdrpm-0.5.0/src/drpm_make.c:748: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).
    if ((patch->nevr = malloc(strlen(name) + strlen(evr) + 2)) == NULL) {
data/libdrpm-0.5.0/src/drpm_make.c:748:46:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if ((patch->nevr = malloc(strlen(name) + strlen(evr) + 2)) == NULL) {
data/libdrpm-0.5.0/src/drpm_make.c:775:64:  [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 ((patch->files[patch->file_count].name = malloc(strlen(filename) + 1)) == NULL) {
data/libdrpm-0.5.0/src/drpm_make.c:790: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).
        if (strlen(filename) == 0)
data/libdrpm-0.5.0/src/drpm_make.c:800:60:  [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 ((patch->files[patch->file_count].name = malloc(strlen(fname) + 1)) == NULL) {
data/libdrpm-0.5.0/src/drpm_make.c:812:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (read(filedesc, &num, 1) != 1) {
data/libdrpm-0.5.0/src/drpm_make.c:818:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                if (read(filedesc, &num2, 1) != 1 ||
data/libdrpm-0.5.0/src/drpm_make.c:819:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                    read(filedesc, &num, 1) != 1) {
data/libdrpm-0.5.0/src/drpm_make.c:839:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                if (read(filedesc, buf + (4 - read_bytes), read_bytes) != read_bytes &&
data/libdrpm-0.5.0/src/drpm_make.c:841:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                    read(filedesc, patch->files[patch->file_count].md5, MD5_DIGEST_LENGTH) != MD5_DIGEST_LENGTH) {
data/libdrpm-0.5.0/src/drpm_make.c:920:51:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if ((rpmprint->files[i].name = malloc(strlen(fname) + 1)) == NULL) {
data/libdrpm-0.5.0/src/drpm_make.c:1044: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 ((delta->src_nevr = malloc(strlen(nevr) + 1)) == NULL ||
data/libdrpm-0.5.0/src/drpm_make.c:1045:40:  [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).
        (delta->head.tgt_nevr = malloc(strlen(nevr) + 1)) == NULL) {
data/libdrpm-0.5.0/src/drpm_options.c:107: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).
        if ((opts_dst->seqfile = malloc(strlen(opts_src->seqfile) + 1)) == NULL)
data/libdrpm-0.5.0/src/drpm_options.c:113: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).
        if ((opts_dst->oldrpmprint = malloc(strlen(opts_src->oldrpmprint) + 1)) == NULL)
data/libdrpm-0.5.0/src/drpm_options.c:119: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).
        if ((opts_dst->oldpatchrpm = malloc(strlen(opts_src->oldpatchrpm) + 1)) == NULL)
data/libdrpm-0.5.0/src/drpm_options.c:241:38:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (opts->seqfile == NULL || strlen(opts->seqfile) < strlen(seqfile)) {
data/libdrpm-0.5.0/src/drpm_options.c:241: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).
        if (opts->seqfile == NULL || strlen(opts->seqfile) < strlen(seqfile)) {
data/libdrpm-0.5.0/src/drpm_options.c:242:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if ((tmp = realloc(opts->seqfile, strlen(seqfile) + 1)) == NULL)
data/libdrpm-0.5.0/src/drpm_options.c:259:38:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (opts->oldrpmprint == NULL || strlen(opts->oldrpmprint) < strlen(oldrpmprint)) {
data/libdrpm-0.5.0/src/drpm_options.c:259:66:  [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 (opts->oldrpmprint == NULL || strlen(opts->oldrpmprint) < strlen(oldrpmprint)) {
data/libdrpm-0.5.0/src/drpm_options.c:260:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if ((tmp = realloc(opts->oldrpmprint, strlen(oldrpmprint) + 1)) == NULL)
data/libdrpm-0.5.0/src/drpm_options.c:264:38:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (opts->oldpatchrpm == NULL || strlen(opts->oldpatchrpm) < strlen(oldpatchrpm)) {
data/libdrpm-0.5.0/src/drpm_options.c:264:66:  [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 (opts->oldpatchrpm == NULL || strlen(opts->oldpatchrpm) < strlen(oldpatchrpm)) {
data/libdrpm-0.5.0/src/drpm_options.c:265:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if ((tmp = realloc(opts->oldpatchrpm, strlen(oldpatchrpm) + 1)) == NULL)
data/libdrpm-0.5.0/src/drpm_read.c:47:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    switch (read(filedesc, buffer, 4)) {
data/libdrpm-0.5.0/src/drpm_read.c:66:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    switch (read(filedesc, buffer, 8)) {
data/libdrpm-0.5.0/src/drpm_read.c:385:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((bytes_read = read(filedesc, delta->head.tgt_nevr, tgt_nevr_len)) < 0)
data/libdrpm-0.5.0/src/drpm_read.c:401:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((bytes_read = read(filedesc, delta->add_data, delta->add_data_len)) < 0)
data/libdrpm-0.5.0/src/drpm_read.c:508:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if ((dst->filename = malloc(strlen(src->filename) + 1)) == NULL ||
data/libdrpm-0.5.0/src/drpm_read.c:510: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).
        (dst->src_nevr = malloc(strlen(src->src_nevr) + 1)) == NULL ||
data/libdrpm-0.5.0/src/drpm_read.c:544: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).
        if ((dst->tgt_nevr = malloc(strlen(src->head.tgt_nevr) + 1)) == NULL) {
data/libdrpm-0.5.0/src/drpm_rpm.c:207:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while ((bytes_read = read(filedesc, buffer, BUFFER_SIZE)) > 0) {
data/libdrpm-0.5.0/src/drpm_rpm.c:631: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(payload_flags) > 2)
data/libdrpm-0.5.0/src/drpm_rpm.c:815: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).
        if ((files[i].name = malloc(strlen(name) + 1)) == NULL ||
data/libdrpm-0.5.0/src/drpm_rpm.c:816:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            (files[i].md5 = malloc(strlen(md5) + 1)) == NULL ||
data/libdrpm-0.5.0/src/drpm_rpm.c:817: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).
            (files[i].linkto = malloc(strlen(linkto) + 1)) == NULL) {
data/libdrpm-0.5.0/src/drpm_rpm.c:1018: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).
        (str = malloc(strlen(nevr) + 1)) == NULL) {
data/libdrpm-0.5.0/src/drpm_utils.c:119: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).
    count = strlen(source) / 2;
data/libdrpm-0.5.0/src/drpm_write.c:93: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).
    src_nevr_len = strlen(delta->src_nevr) + 1;
data/libdrpm-0.5.0/src/drpm_write.c:240: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).
        tgt_nevr_len = strlen(delta->head.tgt_nevr) + 1;
data/libdrpm-0.5.0/test/drpm_api_tests.c:312: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).
    assert_int_equal(MD5_DIGEST_LENGTH * 2, strlen(sequence));
data/libdrpm-0.5.0/test/drpm_api_tests.c:316: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).
    assert_int_equal(MD5_DIGEST_LENGTH * 2, strlen(tgt_md5));
data/libdrpm-0.5.0/test/drpm_api_tests.c:318: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).
    assert_not_in_range(strlen(tgt_lead), 0, (96 + 16) - 1);
data/libdrpm-0.5.0/test/drpm_api_tests.c:392: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).
    assert_not_in_range(strlen(sequence), 0, (MD5_DIGEST_LENGTH * 2) - 1);
data/libdrpm-0.5.0/test/drpm_api_tests.c:396: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).
    assert_int_equal(MD5_DIGEST_LENGTH * 2, strlen(tgt_md5));
data/libdrpm-0.5.0/test/drpm_api_tests.c:398: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).
    assert_not_in_range(strlen(tgt_lead), 0, (96 + 16) - 1);
data/libdrpm-0.5.0/test/drpm_api_tests.c:491: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).
    assert_int_equal(MD5_DIGEST_LENGTH * 2, strlen(sequence));
data/libdrpm-0.5.0/test/drpm_api_tests.c:493: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).
    assert_int_equal(MD5_DIGEST_LENGTH * 2, strlen(tgt_md5));
data/libdrpm-0.5.0/test/drpm_api_tests.c:495: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).
    assert_not_in_range(strlen(tgt_lead), 0, (96 + 16) - 1);
data/libdrpm-0.5.0/test/drpm_api_tests.c:588: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).
    assert_not_in_range(strlen(sequence), 0, (MD5_DIGEST_LENGTH * 2) - 1);
data/libdrpm-0.5.0/test/drpm_api_tests.c:590: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).
    assert_int_equal(MD5_DIGEST_LENGTH * 2, strlen(tgt_md5));
data/libdrpm-0.5.0/test/drpm_api_tests.c:592: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).
    assert_not_in_range(strlen(tgt_lead), 0, (96 + 16) - 1);
data/libdrpm-0.5.0/test/drpm_api_tests.c:685: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).
    assert_int_equal(MD5_DIGEST_LENGTH * 2, strlen(sequence));
data/libdrpm-0.5.0/test/drpm_api_tests.c:687: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).
    assert_int_equal(MD5_DIGEST_LENGTH * 2, strlen(tgt_md5));
data/libdrpm-0.5.0/test/drpm_api_tests.c:689: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).
    assert_not_in_range(strlen(tgt_lead), 0, (96 + 16) - 1);
data/libdrpm-0.5.0/test/drpm_api_tests.c:783: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).
    assert_not_in_range(strlen(sequence), 0, (MD5_DIGEST_LENGTH * 2) - 1);
data/libdrpm-0.5.0/test/drpm_api_tests.c:785: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).
    assert_int_equal(MD5_DIGEST_LENGTH * 2, strlen(tgt_md5));
data/libdrpm-0.5.0/test/drpm_api_tests.c:787: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).
    assert_not_in_range(strlen(tgt_lead), 0, (96 + 16) - 1);
data/libdrpm-0.5.0/test/drpm_api_tests.c:882: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).
    assert_not_in_range(strlen(sequence), 0, (MD5_DIGEST_LENGTH * 2) - 1);
data/libdrpm-0.5.0/test/drpm_api_tests.c:884: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).
    assert_int_equal(MD5_DIGEST_LENGTH * 2, strlen(tgt_md5));
data/libdrpm-0.5.0/test/drpm_api_tests.c:886: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).
    assert_not_in_range(strlen(tgt_lead), 0, (96 + 16) - 1);

ANALYSIS SUMMARY:

Hits = 286
Lines analyzed = 11320 in approximately 0.31 seconds (36522 lines/second)
Physical Source Lines of Code (SLOC) = 8333
Hits@level = [0]   1 [1] 101 [2] 162 [3]   0 [4]  23 [5]   0
Hits@level+ = [0+] 287 [1+] 286 [2+] 185 [3+]  23 [4+]  23 [5+]   0
Hits/KSLOC@level+ = [0+] 34.4414 [1+] 34.3214 [2+] 22.2009 [3+] 2.76011 [4+] 2.76011 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.