commit 50e10c0364479a0d46c3c4958d2f99ed6c412aa6 from: Stefan Sperling date: Thu Aug 29 13:12:46 2024 UTC handle edge-case of zero no-commands in complete_nocmd(); should not happen found by codechecker commit - 7988c7a7cafa0919e92d4885f120536c80021c47 commit + 50e10c0364479a0d46c3c4958d2f99ed6c412aa6 blob - d9710d933043f1f0673ff657387184b53c1ec0ce blob + 6416f700ed687760ca4a391fde869348b89f9840 --- complete.c +++ complete.c @@ -669,6 +669,8 @@ complete_nocmd(struct ghs *nocmd, char *word, int doli if (c->nocmd || c->name == NULL /* sentinel */) nocmdtab_nitems++; } + if (nocmdtab_nitems == 0) + return (CC_ERROR); nocmdtab = calloc(nocmdtab_nitems, sizeof(*nocmdtab)); if (nocmdtab == NULL) return (CC_ERROR);