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 752549 - covertiy warning
covertiy warning
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-07-18 02:31 UTC by Matthias Clasen
Modified: 2015-10-04 16:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthias Clasen 2015-07-18 02:31:20 UTC
Coverity says:

gobject-introspection-1.42.0/girepository/girparser.c:1069: dereference: Dereferencing a pointer that might be null "transfer" when calling "strcmp".
#  1067|     state_switch (ctx, STATE_PASSTHROUGH);
#  1068|   
#  1069|->   if (strcmp (transfer, "full") == 0)
#  1070|       transfer_full = TRUE;
#  1071|     else if (strcmp (transfer, "none") == 0)

and it is right. If find_attribute returns NULL, this will crash. Depending on what outcome is desired here, it could be fixed by adding an if (transfer == NULL) clause before the strcmps or by switching to g_strcmp0.