summaryrefslogtreecommitdiff
path: root/.lgtm
Commit message (Collapse)AuthorAgeFilesLines
* ci: drop LGTM stuff and move remaining bits into a new locationFrantisek Sumsal2022-09-133-180/+0
|
* lgtm: dirname() is now ickyLennart Poettering2022-08-231-0/+3
|
* ci: pack-ify our custom CodeQL queries and enable them in ActionsFrantisek Sumsal2021-12-071-0/+11
| | | | | Unlike LGTM, the CodeQL Action requires the custom queries to have their own qlpack.yml file, so let's provide one.
* lgtm: detect more possible problematic scenariosFrantisek Sumsal2021-12-051-23/+25
| | | | | | | | | | 1) don't ignore stack-allocated variables, since they may hide heap-allocated stuff (compound types) 2) check if there's a return between the variable declaration and its initialization; if so, treat the variable as uninitialized 3) introduction of 2) increased the query runtime exponentially, so introduce some optimizations to bring it back to some reasonable values
* lgtm: ignore certain cleanup functionsFrantisek Sumsal2021-12-051-0/+9
| | | | | as they don't do any illegal stuff even when used with an uninitialized variable.
* lgtm: don't treat the custom note as a list of tagsFrantisek Sumsal2021-12-021-4/+6
| | | | Just a cosmetic change.
* lgtm: detect uninitialized variables using the __cleanup__ attributeFrantisek Sumsal2021-12-021-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a slightly modified version of the original `cpp/uninitialized-local` CodeQL query which focuses only on variables using the cleanup macros. Since this has proven to cause issues in the past, let's panic on every uninitialized variable using any of the cleanup macros (as long as they're written using the __cleanup__ attribute). Some test results from a test I used when writing the query: ``` #define _cleanup_foo_ __attribute__((__cleanup__(foo))) #define _cleanup_(x) __attribute__((__cleanup__(x))) static inline void freep(void *p) { *(void**)p = mfree(*(void**) p); } #define _cleanup_free_ _cleanup_(freep) static inline void foo(char **p) { if (*p) *p = free(*p); } int main(void) { __attribute__((__cleanup__(foo))) char *a; char *b; _cleanup_foo_ char *c; char **d; _cleanup_free_ char *e; int r; r = fun(&e); if (r < 0) return 1; puts(a); puts(b); puts(c); puts(*d); puts(e); return 0; } ``` ``` +| test.c:23:14:23:14 | e | The variable $@ may not be initialized here, but has a cleanup handler. | test.c:20:26:20:26 | e | e | +| test.c:27:10:27:10 | a | The variable $@ may not be initialized here, but has a cleanup handler. | test.c:16:45:16:45 | a | a | +| test.c:29:10:29:10 | c | The variable $@ may not be initialized here, but has a cleanup handler. | test.c:18:25:18:25 | c | c | ```
* lgtm: complain about accept() [people should use accept4() instead, due to ↵Lennart Poettering2019-04-101-0/+3
| | | | O_CLOEXEC]
* lgtm: warn about strerror() useLennart Poettering2019-04-051-0/+3
|
* lgtm: beef up list of dangerous/questionnable API calls not to makeLennart Poettering2019-04-021-2/+20
|
* lgtm: replace the query used for looking for fgets with a more general queryEvgeny Vereshchagin2019-03-122-21/+30
| | | | | | | to make it easier to comlain about `strtok` :-) Inspired by https://github.com/systemd/systemd/pull/11963, which, in turn, was prompted by https://github.com/systemd/systemd/pull/11555.
* lgtm: drop redundant newlinesEvgeny Vereshchagin2018-10-261-2/+0
|
* lgtm: add a custom query for catching the use of fgetsEvgeny Vereshchagin2018-10-261-0/+23
As everybody knows, nodoby really reads CODING_STYLE (especially the last paragraph :-)) so let's utilize LGTM to help us catch the use of fgets.