EasyCwmp

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000131easycwmp[All Projects] Bugpublic2016-05-02 23:122016-05-11 13:02
Reporternriedel 
Assigned Tomohamed.kallel 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
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.
Attached Files

- Relationships

-  Notes
(0000429)
mohamed.kallel (manager)
2016-05-03 13:03

Yes, you are right

This issue will be fixed in the next delivery inchallah
(0000471)
mohamed.kallel (manager)
2016-05-11 13:02

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


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker