]> granicus.if.org Git - sudo/commitdiff
Avoid a clang analyzer false positive.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 12 May 2017 16:02:18 +0000 (10:02 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 12 May 2017 16:02:18 +0000 (10:02 -0600)
plugins/sudoers/auth/sudo_auth.c
plugins/sudoers/ldap.c

index 058a12508e4e48945981295c5b553e21feb480d6..4dcb9ef084163d47f1f7e793e778d40e01a41030 100644 (file)
@@ -295,7 +295,7 @@ verify_user(struct passwd *pw, char *prompt, int validated,
            if (success != AUTH_FAILURE)
                break;
        }
-       if (!standalone) {
+       if (pass != NULL) {
            memset_s(pass, SUDO_CONV_REPL_MAX, 0, strlen(pass));
            free(pass);
        }
index 9b866ad5ee806b5ef3aabe1c44954689e0690274..acd5248790fe9663ee86e3b0f6af4e63af9c298e 100644 (file)
@@ -1453,6 +1453,11 @@ sudo_netgroup_lookup_nested(LDAP *ld, char *base, struct timeval *timeout,
                            ldap_value_free_len(bv);
                            goto oom;
                        }
+#ifdef __clang_analyzer__
+                       /* clang analyzer false positive */
+                       if (__builtin_expect(netgroups->stqh_last == NULL, 0))
+                           __builtin_trap();
+#endif
                        STAILQ_INSERT_TAIL(netgroups, ng, entries);
                        DPRINTF1("Found new netgroup %s for %s", ng->name, base);
                    }