]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix minor issues identified by clang-700.0.72
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 19 Sep 2015 11:39:05 +0000 (12:39 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 19 Sep 2015 20:01:10 +0000 (21:01 +0100)
src/main/evaluate.c
src/main/log.c
src/main/map.c
src/main/radattr.c
src/main/tmpl.c
src/modules/rlm_eap/types/rlm_eap_pwd/rlm_eap_pwd.c
src/modules/rlm_mschap/opendir.c

index c64eebdcb983c6a12e7af3a68d7ef11256ffcf25..bd49e8bb2d4ffda36cea380f3355d2a291ee968a 100644 (file)
@@ -771,8 +771,6 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from, bool d
        REQUEST *fixup = NULL;
        TALLOC_CTX *ctx;
 
-       if (!request) return;
-
        /*
         *      Set up arrays for editing, to remove some of the
         *      O(N^2) dependencies.  This also makes it easier to
index cb2f88c0f9b53d9b62d274d95f2343389dca768f..3ead46e08016cd5e26418fa605f4e04b3699eb1c 100644 (file)
@@ -601,7 +601,7 @@ inline bool radlog_debug_enabled(log_type_t type, log_lvl_t lvl, REQUEST *reques
         *      then don't log the message.
         */
        if ((type & L_DBG) &&
-           ((request && request->log.func && (lvl <= request->log.lvl)) ||
+           ((request->log.func && (lvl <= request->log.lvl)) ||
             ((rad_debug_lvl != 0) && (lvl <= rad_debug_lvl)))) {
                return true;
        }
index 88d89c19130e70b4c0ef6504947bbdf21556fc44..bbe3a6304f59eba21b3dfedfd927b96ce9b4936f 100644 (file)
@@ -340,8 +340,6 @@ int map_afrom_cs(vp_map_t **out, CONF_SECTION *cs,
        *out = NULL;
        tail = out;
 
-       if (!cs) return 0;
-
        /*
         *      The first map has cs as the parent.
         *      The rest have the previous map as the parent.
index 2a6c59b391ea95d8d66686c9c1cbbae0dc54d860..3badef98c49910d29a038992ac6143742d3519e7 100644 (file)
@@ -695,7 +695,12 @@ static void process_file(const char *root_dir, char const *filename)
                        attr = data;
                        vp = head;
                        while (vp) {
-                               len = rad_vp2attr(&my_packet, &my_original, my_secret, (VALUE_PAIR const **)(void **)&vp,
+                               VALUE_PAIR **pvp = &vp;
+                               VALUE_PAIR const **qvp;
+
+                               memcpy(&qvp, &pvp, sizeof(pvp));
+
+                               len = rad_vp2attr(&my_packet, &my_original, my_secret, qvp,
                                                  attr, data + sizeof(data) - attr);
                                if (len < 0) {
                                        fprintf(stderr, "Failed encoding %s: %s\n",
index 7106f00aacf3fac165b61e9c18cadad2eeaac13a..ae89b33b899c39aac926a46135124f0ad812b04d 100644 (file)
@@ -2197,7 +2197,7 @@ void tmpl_verify(char const *file, int line, vp_tmpl_t const *vpt)
                }
 
                if (vpt->tmpl_da->flags.is_unknown) {
-                       if (vpt->tmpl_da != (DICT_ATTR *)&vpt->data.attribute.unknown.da) {
+                       if (vpt->tmpl_da != (DICT_ATTR const *)&vpt->data.attribute.unknown.da) {
                                FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: TMPL_TYPE_ATTR "
                                             "da is marked as unknown, but does not point to the template's "
                                             "unknown da buffer", file, line);
index d1813abdbb782581d4a17debcc10f9095f268b4d..6220bbdc532e85eb95daca78da0ba2068473e903 100644 (file)
@@ -281,7 +281,7 @@ static int mod_process(void *arg, eap_handler_t *handler)
        BIGNUM *x = NULL, *y = NULL;
        char *p;
 
-       if (!handler || ((eap_ds = handler->eap_ds) == NULL) || !inst) return 0;
+       if (((eap_ds = handler->eap_ds) == NULL) || !inst) return 0;
 
        session = (pwd_session_t *)handler->opaque;
        request = handler->request;
index fa8c816501605743cee145dfed5877a32a58dece..1b37811fe5ffcc3fefcb8f4d563fabb1737732ba 100644 (file)
@@ -52,7 +52,7 @@ static rlm_rcode_t getUserNodeRef(REQUEST *request, char* inUserName, char **out
        tDataBuffer             *tDataBuff      = NULL;
        tDirNodeReference       nodeRef         = 0;
        long                    status          = eDSNoErr;
-       char                    *what           = NULL;
+       char const              *what           = NULL;
        char                    *status_name    = NULL;
        tContextData            context         = 0;
        uint32_t                nodeCount       = 0;
@@ -63,9 +63,9 @@ static rlm_rcode_t getUserNodeRef(REQUEST *request, char* inUserName, char **out
        tDataList              *pRecType        = NULL;
        tDataList              *pAttrType       = NULL;
        uint32_t                recCount        = 0;
-       tRecordEntry        *pRecEntry  = NULL;
+       tRecordEntry            *pRecEntry      = NULL;
        tAttributeListRef       attrListRef     = 0;
-       char                *pUserLocation      = NULL;
+       char                    *pUserLocation  = NULL;
        tAttributeValueListRef  valueRef        = 0;
        tDataList              *pUserNode       = NULL;
        rlm_rcode_t             result          = RLM_MODULE_FAIL;