|
| 1 | +Error: GCC_ANALYZER_WARNING (CWE-401): |
| 2 | +logrotate-3.18.0/config.c: scope_hint: In function 'readAddress' |
| 3 | +logrotate-3.18.0/config.c:376:8: warning[-Wanalyzer-malloc-leak]: leak of 'key' |
| 4 | +logrotate-3.18.0/config.c:14: included_from: Included from here. |
| 5 | +logrotate-3.18.0/config.c:3: included_from: Included from here. |
| 6 | +logrotate-3.18.0/config.c:1354:25: note: in expansion of macro 'freeLogItem' |
| 7 | +# 374| char *address = isolateValue(configFile, lineNum, key, startPtr, buf, length); |
| 8 | +# 375| |
| 9 | +# 376|-> if (address != NULL) { |
| 10 | +# 377| /* validate the address */ |
| 11 | +# 378| const char *chptr = address; |
| 12 | + |
| 13 | +Error: TOCTOU (CWE-367): |
| 14 | +logrotate-3.18.0/config.c:648: fs_check_call: Calling function "stat" to perform check on "path". |
| 15 | +logrotate-3.18.0/config.c:666: toctou: Calling function "opendir" that uses "path" after a check function. This can cause a time-of-check, time-of-use race condition. |
| 16 | +# 646| struct logInfo defConfigBackup; |
| 17 | +# 647| |
| 18 | +# 648|-> if (stat(path, &sb)) { |
| 19 | +# 649| message(MESS_ERROR, "cannot stat %s: %s\n", path, strerror(errno)); |
| 20 | +# 650| return 1; |
| 21 | + |
| 22 | +Error: GCC_ANALYZER_WARNING (CWE-401): |
| 23 | +logrotate-3.18.0/config.c: scope_hint: In function 'readConfigFile' |
| 24 | +logrotate-3.18.0/config.c:1149:28: warning[-Wanalyzer-malloc-leak]: leak of 'key' |
| 25 | +logrotate-3.18.0/config.c:14: included_from: Included from here. |
| 26 | +logrotate-3.18.0/config.c:3: included_from: Included from here. |
| 27 | +# 1147| free(key); |
| 28 | +# 1148| key = isolateLine(&start, &buf, length); |
| 29 | +# 1149|-> if (key == NULL) |
| 30 | +# 1150| continue; |
| 31 | +# 1151| |
| 32 | + |
| 33 | +Error: GCC_ANALYZER_WARNING (CWE-401): |
| 34 | +logrotate-3.18.0/config.c:1180:28: warning[-Wanalyzer-malloc-leak]: leak of 'key' |
| 35 | +logrotate-3.18.0/config.c:14: included_from: Included from here. |
| 36 | +logrotate-3.18.0/config.c:3: included_from: Included from here. |
| 37 | +# 1178| free(key); |
| 38 | +# 1179| key = isolateLine(&start, &buf, length); |
| 39 | +# 1180|-> if (key == NULL) |
| 40 | +# 1181| continue; |
| 41 | +# 1182| |
| 42 | + |
| 43 | +Error: GCC_ANALYZER_WARNING (CWE-401): |
| 44 | +logrotate-3.18.0/config.c:1196:28: warning[-Wanalyzer-malloc-leak]: leak of 'key' |
| 45 | +logrotate-3.18.0/config.c:14: included_from: Included from here. |
| 46 | +logrotate-3.18.0/config.c:3: included_from: Included from here. |
| 47 | +# 1194| free(key); |
| 48 | +# 1195| key = isolateLine(&start, &buf, length); |
| 49 | +# 1196|-> if (key == NULL) |
| 50 | +# 1197| continue; |
| 51 | +# 1198| |
| 52 | + |
| 53 | +Error: GCC_ANALYZER_WARNING (CWE-401): |
| 54 | +logrotate-3.18.0/config.c:1263:28: warning[-Wanalyzer-malloc-leak]: leak of 'key' |
| 55 | +logrotate-3.18.0/config.c:14: included_from: Included from here. |
| 56 | +logrotate-3.18.0/config.c:3: included_from: Included from here. |
| 57 | +# 1261| key = isolateValue(configFile, lineNum, "shred cycles", |
| 58 | +# 1262| &start, &buf, length); |
| 59 | +# 1263|-> if (key == NULL) |
| 60 | +# 1264| continue; |
| 61 | +# 1265| newlog->shred_cycles = (int)strtoul(key, &chptr, 0); |
| 62 | + |
| 63 | +Error: GCC_ANALYZER_WARNING (CWE-401): |
| 64 | +logrotate-3.18.0/config.c:1304:28: warning[-Wanalyzer-malloc-leak]: leak of 'key' |
| 65 | +logrotate-3.18.0/config.c:14: included_from: Included from here. |
| 66 | +logrotate-3.18.0/config.c:3: included_from: Included from here. |
| 67 | +# 1302| key = isolateValue(configFile, lineNum, "rotate count", &start, |
| 68 | +# 1303| &buf, length); |
| 69 | +# 1304|-> if (key == NULL) |
| 70 | +# 1305| continue; |
| 71 | +# 1306| newlog->rotateCount = (int)strtol(key, &chptr, 0); |
| 72 | + |
| 73 | +Error: GCC_ANALYZER_WARNING (CWE-401): |
| 74 | +logrotate-3.18.0/config.c:1317:28: warning[-Wanalyzer-malloc-leak]: leak of 'key' |
| 75 | +logrotate-3.18.0/config.c:14: included_from: Included from here. |
| 76 | +logrotate-3.18.0/config.c:3: included_from: Included from here. |
| 77 | +# 1315| key = isolateValue(configFile, lineNum, "start count", &start, |
| 78 | +# 1316| &buf, length); |
| 79 | +# 1317|-> if (key == NULL) |
| 80 | +# 1318| continue; |
| 81 | +# 1319| newlog->logStart = (int)strtoul(key, &chptr, 0); |
| 82 | + |
| 83 | +Error: GCC_ANALYZER_WARNING (CWE-401): |
| 84 | +logrotate-3.18.0/config.c:1329:28: warning[-Wanalyzer-malloc-leak]: leak of 'key' |
| 85 | +logrotate-3.18.0/config.c:14: included_from: Included from here. |
| 86 | +logrotate-3.18.0/config.c:3: included_from: Included from here. |
| 87 | +# 1327| key = isolateValue(configFile, lineNum, "minage count", &start, |
| 88 | +# 1328| &buf, length); |
| 89 | +# 1329|-> if (key == NULL) |
| 90 | +# 1330| continue; |
| 91 | +# 1331| newlog->rotateMinAge = (int)strtoul(key, &chptr, 0); |
| 92 | + |
| 93 | +Error: GCC_ANALYZER_WARNING (CWE-401): |
| 94 | +logrotate-3.18.0/config.c:1341:28: warning[-Wanalyzer-malloc-leak]: leak of 'key' |
| 95 | +logrotate-3.18.0/config.c:14: included_from: Included from here. |
| 96 | +logrotate-3.18.0/config.c:3: included_from: Included from here. |
| 97 | +# 1339| key = isolateValue(configFile, lineNum, "maxage count", &start, |
| 98 | +# 1340| &buf, length); |
| 99 | +# 1341|-> if (key == NULL) |
| 100 | +# 1342| continue; |
| 101 | +# 1343| newlog->rotateAge = (int)strtoul(key, &chptr, 0); |
| 102 | + |
| 103 | +Error: GCC_ANALYZER_WARNING (CWE-401): |
| 104 | +logrotate-3.18.0/config.c:1405:28: warning[-Wanalyzer-malloc-leak]: leak of 'key' |
| 105 | +logrotate-3.18.0/config.c:14: included_from: Included from here. |
| 106 | +logrotate-3.18.0/config.c:3: included_from: Included from here. |
| 107 | +# 1403| key = isolateValue(configFile, lineNum, "tabooext", &start, |
| 108 | +# 1404| &buf, length); |
| 109 | +# 1405|-> if (key == NULL) |
| 110 | +# 1406| continue; |
| 111 | +# 1407| endtag = key; |
| 112 | + |
| 113 | +Error: GCC_ANALYZER_WARNING (CWE-401): |
| 114 | +logrotate-3.18.0/config.c:1464:28: warning[-Wanalyzer-malloc-leak]: leak of 'key' |
| 115 | +logrotate-3.18.0/config.c:14: included_from: Included from here. |
| 116 | +logrotate-3.18.0/config.c:3: included_from: Included from here. |
| 117 | +# 1462| key = isolateValue(configFile, lineNum, "taboopat", &start, |
| 118 | +# 1463| &buf, length); |
| 119 | +# 1464|-> if (key == NULL) |
| 120 | +# 1465| continue; |
| 121 | +# 1466| |
| 122 | + |
| 123 | +Error: GCC_ANALYZER_WARNING (CWE-401): |
| 124 | +logrotate-3.18.0/config.c:1514:28: warning[-Wanalyzer-malloc-leak]: leak of 'key' |
| 125 | +logrotate-3.18.0/config.c:14: included_from: Included from here. |
| 126 | +logrotate-3.18.0/config.c:3: included_from: Included from here. |
| 127 | +# 1512| key = isolateValue(configFile, lineNum, "include", &start, |
| 128 | +# 1513| &buf, length); |
| 129 | +# 1514|-> if (key == NULL) |
| 130 | +# 1515| continue; |
| 131 | +# 1516| |
| 132 | + |
| 133 | +Error: RESOURCE_LEAK (CWE-772): |
| 134 | +logrotate-3.18.0/logrotate.c:338: alloc_arg: "fgetfilecon_raw" allocates memory that is stored into "srcCtx". |
| 135 | +logrotate-3.18.0/logrotate.c:351: leaked_storage: Variable "srcCtx" going out of scope leaks the storage it points to. |
| 136 | +# 349| if (getfscreatecon_raw(pPrevCtx) < 0) { |
| 137 | +# 350| message(MESS_ERROR, "getting default context: %s\n", strerror(errno)); |
| 138 | +# 351|-> return selinux_enforce; |
| 139 | +# 352| } |
| 140 | +# 353| |
| 141 | + |
| 142 | +Error: RESOURCE_LEAK (CWE-772): |
| 143 | +logrotate-3.18.0/logrotate.c:793: alloc_arg: "setSecCtx" allocates memory that is stored into "prevCtx". |
| 144 | +logrotate-3.18.0/logrotate.c:796: leaked_storage: Variable "prevCtx" going out of scope leaks the storage it points to. |
| 145 | +# 794| /* error msg already printed */ |
| 146 | +# 795| close(inFile); |
| 147 | +# 796|-> return 1; |
| 148 | +# 797| } |
| 149 | +# 798| |
| 150 | + |
| 151 | +Error: RESOURCE_LEAK (CWE-772): |
| 152 | +logrotate-3.18.0/logrotate.c:1178: alloc_arg: "setSecCtx" allocates memory that is stored into "prevCtx". |
| 153 | +logrotate-3.18.0/logrotate.c:1180: leaked_storage: Variable "prevCtx" going out of scope leaks the storage it points to. |
| 154 | +# 1178| if (setSecCtx(fdcurr, currLog, &prevCtx) != 0) { |
| 155 | +# 1179| /* error msg already printed */ |
| 156 | +# 1180|-> goto fail; |
| 157 | +# 1181| } |
| 158 | +# 1182| #ifdef WITH_ACL |
| 159 | + |
| 160 | +Error: TOCTOU (CWE-367): |
| 161 | +logrotate-3.18.0/logrotate.c:1934: fs_check_call: Calling function "stat" to perform check on "oldName". |
| 162 | +logrotate-3.18.0/logrotate.c:1962: toctou: Calling function "rename" that uses "oldName" after a check function. This can cause a time-of-check, time-of-use race condition. |
| 163 | +# 1932| struct stat fst_buf; |
| 164 | +# 1933| |
| 165 | +# 1934|-> if (stat(oldName, &fst_buf)) { |
| 166 | +# 1935| if (errno == ENOENT) { |
| 167 | +# 1936| message(MESS_DEBUG, "old log %s does not exist\n", |
| 168 | + |
| 169 | +Error: RESOURCE_LEAK (CWE-772): |
| 170 | +logrotate-3.18.0/logrotate.c:2032: alloc_arg: "setSecCtxByName" allocates memory that is stored into "savedContext". |
| 171 | +logrotate-3.18.0/logrotate.c:2034: leaked_storage: Variable "savedContext" going out of scope leaks the storage it points to. |
| 172 | +# 2032| if (setSecCtxByName(log->files[logNum], &savedContext) != 0) { |
| 173 | +# 2033| /* error msg already printed */ |
| 174 | +# 2034|-> return 1; |
| 175 | +# 2035| } |
| 176 | +# 2036| #ifdef WITH_ACL |
| 177 | + |
| 178 | +Error: RESOURCE_LEAK (CWE-772): |
| 179 | +logrotate-3.18.0/logrotate.c:2533: alloc_arg: "setSecCtx" allocates memory that is stored into "prevCtx". |
| 180 | +logrotate-3.18.0/logrotate.c:2537: leaked_storage: Variable "prevCtx" going out of scope leaks the storage it points to. |
| 181 | +# 2535| free(tmpFilename); |
| 182 | +# 2536| close(fdcurr); |
| 183 | +# 2537|-> return 1; |
| 184 | +# 2538| } |
| 185 | +# 2539| |
0 commit comments