View Issue Details

IDProjectCategoryView StatusLast Update
0000131easycwmpBugpublic2016-05-11 13:02
Reporternriedel Assigned Tomohamed.kallel  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Summary0000131: Incorrect use of comma operator in loops in xml.c
DescriptionMy understanding of the comma operator is that it evaluates from left to right, and returns the last (right-most) result. In xml.c at around line 132 in the function xml_free_ns() we have:

    FREE(ns.cwmp);
    for (i = 0; i < ARRAY_SIZE(ns.soap_env), ns.soap_env[i]; i++) {
        FREE(ns.soap_env[i]);
    }

The first conditional of the for loop end condition (i < ARRAY_SIZE(ns.soap_env)) has no effect. This is a problem if the ns.soap_env[] array is every full. I think the correct code is:
    FREE(ns.cwmp);
    for (i = 0; i < ARRAY_SIZE(ns.soap_env) && ns.soap_env[i]; i++) {
        FREE(ns.soap_env[i]);
    }

The same problem occurs in xml_mxml_find_note_by_env_type() at line 196.

Steps To ReproduceCode inspection.
TagsNo tags attached.
e-mail notification

Activities

mohamed.kallel

2016-05-03 13:03

administrator   ~0000429

Yes, you are right

This issue will be fixed in the next delivery inchallah

mohamed.kallel

2016-05-11 13:02

administrator   ~0000471

fixed in EasyCwmp-1.2.8

Issue History

Date Modified Username Field Change
2016-05-02 23:12 nriedel New Issue
2016-05-03 13:03 mohamed.kallel Note Added: 0000429
2016-05-11 13:02 mohamed.kallel Note Added: 0000471
2016-05-11 13:02 mohamed.kallel Status new => resolved
2016-05-11 13:02 mohamed.kallel Resolution open => fixed
2016-05-11 13:02 mohamed.kallel Assigned To => mohamed.kallel