Menu

#19 libdbus-c++-0.9.0/tools/xml.cpp:300: possible bad order of condition ?

all
open
nobody
None
1
2014-01-14
2014-01-14
dcb
No

I just ran the static analyser "cppcheck" over the
source code of libdbus-c++-0.9.0

It said many things, including

[xml.cpp:300]: (style) Array index 'x' is used before limits check.

Source code is

while (isspace(chars[x]) && x < y) ++x;

Maybe

while (z < y && isspace(chars[x])) ++x;

might be better code.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.