View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000131 | easycwmp | Bug | public | 2016-05-02 23:12 | 2016-05-11 13:02 |
Reporter | nriedel | Assigned To | mohamed.kallel | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Summary | 0000131: Incorrect use of comma operator in loops in xml.c | ||||
Description | My 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 Reproduce | Code inspection. | ||||
Tags | No tags attached. | ||||
e-mail notification | |||||
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 |