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/logrotate-3.17.0/log.c
Examining data/logrotate-3.17.0/log.h
Examining data/logrotate-3.17.0/logrotate.h
Examining data/logrotate-3.17.0/queue.h
Examining data/logrotate-3.17.0/logrotate.c
Examining data/logrotate-3.17.0/config.c

FINAL RESULTS:

data/logrotate-3.17.0/config.c:401:13:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
        if (chown(path, uid, gid) != 0) {
data/logrotate-3.17.0/config.c:407:13:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
        if (chmod(path, mode) != 0) {
data/logrotate-3.17.0/config.c:63:12:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    size = vsnprintf(NULL, 0, format, arg);
data/logrotate-3.17.0/config.c:77:10:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    rv = vsnprintf(str, size, format, arg);
data/logrotate-3.17.0/config.c:1901:29:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
                            sprintf(ld, "%s/%s", dirName, newlog->oldDir);
data/logrotate-3.17.0/log.c:40:24:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
__attribute__((format (printf, 3, 0)))
data/logrotate-3.17.0/log.c:53:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(where, format, args);
data/logrotate-3.17.0/log.c:57:24:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
__attribute__((format (printf, 2, 3)))
data/logrotate-3.17.0/log.h:17:28:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    __attribute__ ((format(printf, 2, 3)));
data/logrotate-3.17.0/logrotate.c:497: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("/bin/sh", "sh", "-c", (char *) script, "logrotate_script", (char *) logfn, (char *) logrotfn, (char *) NULL);
data/logrotate-3.17.0/logrotate.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(ptr, fileName);
data/logrotate-3.17.0/logrotate.c:686:9:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        execvp(fullCommand[0], (void *) fullCommand);
data/logrotate-3.17.0/logrotate.c:786:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(compressedName, "%s%s", name, log->compress_ext);
data/logrotate-3.17.0/logrotate.c:861:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(envInFilename, "LOGROTATE_COMPRESSED_FILENAME=%s", name);
data/logrotate-3.17.0/logrotate.c:863:9:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        execvp(fullCommand[0], (void *) fullCommand);
data/logrotate-3.17.0/logrotate.c:953:13:  [4] (shell) execlp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
            execlp(uncompressCommand, uncompressCommand, (char *) NULL);
data/logrotate-3.17.0/logrotate.c:982:9:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        execvp(mailArgv[0], mailArgv);
data/logrotate-3.17.0/logrotate.c:1581:17:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
                sprintf(rotNames->dirName, "%s/%s", ld, log->oldDir);
data/logrotate-3.17.0/logrotate.c:1885:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(rotNames->firstRotated, "%s/%s%s%s%s",
data/logrotate-3.17.0/logrotate.c:1918:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(rotNames->firstRotated, "%s/%s.%d%s%s", rotNames->dirName,
data/logrotate-3.17.0/logrotate.c:2008:34:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (rotNames->disposeName && access(rotNames->disposeName, F_OK)) {
data/logrotate-3.17.0/logrotate.c:2508: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(tmpFilename, stateFilename);
data/logrotate-3.17.0/config.c:49:23:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
#define secure_getenv getenv
data/logrotate-3.17.0/config.c:100: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, s, nAvail);
data/logrotate-3.17.0/config.c:322: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 u[200], g[200];
data/logrotate-3.17.0/config.c:664: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 ((here = open(".", O_RDONLY)) == -1) {
data/logrotate-3.17.0/config.c:979: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(configFile, O_RDONLY);
data/logrotate-3.17.0/logrotate.c:376: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).
    int fd = open(src, O_RDONLY | O_NOFOLLOW);
data/logrotate-3.17.0/logrotate.c:534: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(fileName, (flags | O_EXCL | O_NOFOLLOW),
data/logrotate-3.17.0/logrotate.c:554: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(ptr, ".backup");
data/logrotate-3.17.0/logrotate.c:630: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 count[DIGITS];    /*  that's a lot of shredding :)  */
data/logrotate-3.17.0/logrotate.c:720: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(name, O_RDWR | O_NOFOLLOW);
data/logrotate-3.17.0/logrotate.c:768: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 buff[4092];
data/logrotate-3.17.0/logrotate.c:788:19:  [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 ((inFile = open(name, O_RDWR | O_NOFOLLOW)) < 0) {
data/logrotate-3.17.0/logrotate.c:915: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).
    if ((mailInput = open(logFile, O_RDONLY | O_NOFOLLOW)) < 0) {
data/logrotate-3.17.0/logrotate.c:1099: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 + 1];
data/logrotate-3.17.0/logrotate.c:1169:23:  [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 ((fdcurr = open(currLog, ((read_only) ? O_RDONLY : O_RDWR) | O_NOFOLLOW)) < 0) {
data/logrotate-3.17.0/logrotate.c:1243: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(&tmp, src, sizeof tmp);
data/logrotate-3.17.0/logrotate.c:1543: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 dext_str[DATEEXT_LEN];
data/logrotate-3.17.0/logrotate.c:1544: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 dformat[PATTERN_LEN] = "";
data/logrotate-3.17.0/logrotate.c:1545: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 dext_pattern[PATTERN_LEN];
data/logrotate-3.17.0/logrotate.c:2509: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(tmpFilename, ".tmp");
data/logrotate-3.17.0/logrotate.c:2520: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).
    fdcurr = open(stateFilename, O_RDONLY);
data/logrotate-3.17.0/logrotate.c:2688: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[STATEFILE_BUFFER_SIZE];
data/logrotate-3.17.0/logrotate.c:2702: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(stateFilename, O_RDONLY);
data/logrotate-3.17.0/logrotate.c:2900: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).
    int lockFd = open(stateFilename, O_RDWR | O_CLOEXEC);
data/logrotate-3.17.0/logrotate.c:2907: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).
            lockFd = open(stateFilename, O_CREAT | O_EXCL | O_WRONLY,
data/logrotate-3.17.0/logrotate.c:2999:29:  [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).
                    logFd = fopen(logFile, "w");
data/logrotate-3.17.0/config.c:93: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).
    nAvail = strlen(s) + 1;
data/logrotate-3.17.0/config.c:239: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).
        while (*chptr && (len = mbrtowc(&pwc, chptr, strlen(chptr), NULL)) != 0) {
data/logrotate-3.17.0/config.c:332:14:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
        rc = sscanf(key, "%ho %199s %199s%c", &parsed_mode, u, g, &tmp);
data/logrotate-3.17.0/config.c:338:14:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
        rc = sscanf(key, "%199s %199s%c", u, g, &tmp);
data/logrotate-3.17.0/config.c:1223: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).
                            const size_t l = strlen(key) - 1;
data/logrotate-3.17.0/config.c:1895: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).
                            ld = malloc(strlen(dirName) + strlen(newlog->oldDir) + 2);
data/logrotate-3.17.0/config.c:1895:59:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                            ld = malloc(strlen(dirName) + strlen(newlog->oldDir) + 2);
data/logrotate-3.17.0/logrotate.c:252:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        memmove(p, p+1, 1 + strlen(p+1));
data/logrotate-3.17.0/logrotate.c:542: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).
        fileName_size = strlen(fileName);
data/logrotate-3.17.0/logrotate.c:785:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    compressedName = alloca(strlen(name) + strlen(log->compress_ext) + 2);
data/logrotate-3.17.0/logrotate.c:785: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).
    compressedName = alloca(strlen(name) + strlen(log->compress_ext) + 2);
data/logrotate-3.17.0/logrotate.c:860: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).
        envInFilename = alloca(strlen("LOGROTATE_COMPRESSED_FILENAME=") + strlen(name) + 2);
data/logrotate-3.17.0/logrotate.c:860:75:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        envInFilename = alloca(strlen("LOGROTATE_COMPRESSED_FILENAME=") + strlen(name) + 2);
data/logrotate-3.17.0/logrotate.c:871:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((n_read = read(compressPipe[0], buff, sizeof(buff) - 1)) > 0) {
data/logrotate-3.17.0/logrotate.c:1104:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        const ssize_t n_read = read (src_fd, buf, MIN (max_n_read, BUFSIZ));
data/logrotate-3.17.0/logrotate.c:1498: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).
    prefixLen = strlen(rotNames->dirName) + /* '/' */1
data/logrotate-3.17.0/logrotate.c:1499: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).
        + strlen(rotNames->baseName) + /* '.' */ 1;
data/logrotate-3.17.0/logrotate.c:1500: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).
    suffixLen = strlen(fileext) + strlen(compext);
data/logrotate-3.17.0/logrotate.c:1500: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).
    suffixLen = strlen(fileext) + strlen(compext);
data/logrotate-3.17.0/logrotate.c:1504: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).
        const size_t fileNameLen = strlen(fileName);
data/logrotate-3.17.0/logrotate.c:1580: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).
                    malloc(strlen(ld) + strlen(log->oldDir) + 2);
data/logrotate-3.17.0/logrotate.c:1580: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).
                    malloc(strlen(ld) + strlen(log->oldDir) + 2);
data/logrotate-3.17.0/logrotate.c:1612: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).
        const size_t baseLen = strlen(rotNames->baseName);
data/logrotate-3.17.0/logrotate.c:1613: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).
        const size_t extLen = strlen(log->addextension);
data/logrotate-3.17.0/logrotate.c:1631: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).
        const size_t baseLen = strlen(rotNames->baseName);
data/logrotate-3.17.0/logrotate.c:1632: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).
        const size_t extLen = strlen(log->extension);
data/logrotate-3.17.0/logrotate.c:1682:25:  [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. Risk is low because the source is a
  constant string.
                        strncat(dext_pattern, "[0-9][0-9]",
data/logrotate-3.17.0/logrotate.c:1683:56:  [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).
                                sizeof(dext_pattern) - strlen(dext_pattern) - 1);
data/logrotate-3.17.0/logrotate.c:1692:25:  [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. Risk is low because the source is a
  constant string.
                        strncat(dext_pattern, "[0-9][0-9]",
data/logrotate-3.17.0/logrotate.c:1693:56:  [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).
                                sizeof(dext_pattern) - strlen(dext_pattern) - 1);
data/logrotate-3.17.0/logrotate.c:1706:25:  [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. Risk is low because the source is a
  constant string.
                        strncat(dext_pattern,
data/logrotate-3.17.0/logrotate.c:1708:56:  [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).
                                sizeof(dext_pattern) - strlen(dext_pattern) - 1);
data/logrotate-3.17.0/logrotate.c:1739:13:  [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(dext_pattern, "-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]",
data/logrotate-3.17.0/logrotate.c:1744:13:  [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(dext_pattern, "-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]",
data/logrotate-3.17.0/logrotate.c:1770: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).
                sortGlobResult(&globResult, strlen(rotNames->dirName) + 1 + strlen(rotNames->baseName), dformat);
data/logrotate-3.17.0/logrotate.c:1770:77:  [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).
                sortGlobResult(&globResult, strlen(rotNames->dirName) + 1 + strlen(rotNames->baseName), dformat);
data/logrotate-3.17.0/logrotate.c:1815: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).
        malloc(strlen(rotNames->dirName) + strlen(rotNames->baseName) +
data/logrotate-3.17.0/logrotate.c:1815: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).
        malloc(strlen(rotNames->dirName) + strlen(rotNames->baseName) +
data/logrotate-3.17.0/logrotate.c:1816: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).
                strlen(fileext) + strlen(compext) + DATEEXT_LEN + 2 );
data/logrotate-3.17.0/logrotate.c:1816: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).
                strlen(fileext) + strlen(compext) + DATEEXT_LEN + 2 );
data/logrotate-3.17.0/logrotate.c:1840: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).
            sortGlobResult(&globResult, strlen(rotNames->dirName) + 1 + strlen(rotNames->baseName), dformat);
data/logrotate-3.17.0/logrotate.c:1840:73:  [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).
            sortGlobResult(&globResult, strlen(rotNames->dirName) + 1 + strlen(rotNames->baseName), dformat);
data/logrotate-3.17.0/logrotate.c:2503:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    tmpFilename = malloc(strlen(stateFilename) + 5 );
data/logrotate-3.17.0/logrotate.c:2771:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        const size_t i = strlen(buf);

ANALYSIS SUMMARY:

Hits = 92
Lines analyzed = 6011 in approximately 0.20 seconds (30556 lines/second)
Physical Source Lines of Code (SLOC) = 4906
Hits@level = [0]  22 [1]  44 [2]  25 [3]   1 [4]  20 [5]   2
Hits@level+ = [0+] 114 [1+]  92 [2+]  48 [3+]  23 [4+]  22 [5+]   2
Hits/KSLOC@level+ = [0+] 23.2369 [1+] 18.7525 [2+] 9.78394 [3+] 4.68814 [4+] 4.4843 [5+] 0.407664
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.