After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 689701 - There's an unitialised variable error in gupnp-didl-lite-writer.c
There's an unitialised variable error in gupnp-didl-lite-writer.c
Status: RESOLVED FIXED
Product: gupnp-av
Classification: Other
Component: General
0.9.x
Other Linux
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-12-05 14:48 UTC by Mark Ryan
Modified: 2019-02-22 05:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix unitialised variable (912 bytes, patch)
2012-12-05 14:48 UTC, Mark Ryan
committed Details | Review

Description Mark Ryan 2012-12-05 14:48:39 UTC
Created attachment 230764 [details] [review]
Patch to fix unitialised variable

The is_container variable is only initialised if node->name = "container",
otherwise it is uninitialised.  I've attached a patch to initialise the variable.

This issue was spotted by Coverity.

Actually, I'm not sure that this patch will do anything apart from make the coverity error go away.  As far as I can tell, node->name can have 3 different values, "container", "item",  and "desc".  I'm guessing only "container"s have children so is_container probably never gets tested when it is unintialised.  Is this analysis correct?  If not, are there any tests that need to be run apart from make check, which seems to run fine with this patch.
Comment 1 Jens Georg 2012-12-05 15:08:45 UTC
Interesting, the code is rather old, wonder why the coverity in the beginning of this year didn't find that.
Comment 2 Jens Georg 2012-12-05 15:17:40 UTC
Children is on XML level, <item> does have child nodes as well, so this fix looks rather important.