Navigation


Changeset 1179:f5e9b53d6f86 in freeDiameter for extensions


Ignore:
Timestamp:
Jun 4, 2013, 7:41:07 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Fix invalid NULL pointer indirection in log

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/rt_default/rtd_rules.c

    r1127 r1179  
    414414       
    415415        TRACE_ENTRY("%d %p %d %p %d %x", ct, criteria, tt, target, score, flags);
    416         CHECK_PARAMS((ct < RTD_CRI_MAX) && ((ct == 0) || criteria) && (tt < RTD_TAR_MAX) && target);
     416        CHECK_PARAMS((ct < RTD_CRI_MAX) && ((ct == RTD_CRI_ALL) || criteria) && (tt < RTD_TAR_MAX) && target);
    417417       
    418418        /* First, search in the TARGET list if we already have this target */
     
    451451       
    452452        /* Now, search for the rule position in this target's list */
    453         if (ct == 0) {
     453        if (ct == RTD_CRI_ALL) {
    454454                /* Special case: we don't have a criteria -- always create a rule element */
    455455                CHECK_MALLOC( rul = new_rule(NULL, 0, score) );
    456                 fd_list_insert_before( &trg->rules[0], &rul->chain );
     456                fd_list_insert_before( &trg->rules[RTD_CRI_ALL], &rul->chain );
    457457        } else {
    458458                for (rule_suiv = trg->rules[ct].next; rule_suiv != &trg->rules[ct]; rule_suiv = rule_suiv->next) {
     
    536536                               
    537537                                /* First, apply all rules of criteria RTD_CRI_ALL */
    538                                 for ( l = target->rules[0].next; l != &target->rules[0]; l = l->next ) {
     538                                for ( l = target->rules[RTD_CRI_ALL].next; l != &target->rules[RTD_CRI_ALL]; l = l->next ) {
    539539                                        r = (struct rule *)l;
    540540                                        cand->score += r->score;
    541                                         TRACE_DEBUG(ANNOYING, "Applied rule {'%s' : '%s' += %d} to candidate '%s'", r->md.plain, target->md.plain, r->score, cand->diamid);
     541                                        TRACE_DEBUG(ANNOYING, "Applied rule {'*' : '%s' += %d} to candidate '%s'", target->md.plain, r->score, cand->diamid);
    542542                                }
    543543                               
Note: See TracChangeset for help on using the changeset viewer.