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 702755 - g_bytes_get_data() annotation should use (element-type guint8)
g_bytes_get_data() annotation should use (element-type guint8)
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: general
2.36.x
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on: 755961
Blocks:
 
 
Reported: 2013-06-20 15:49 UTC by Jan Kneschke
Modified: 2018-02-08 12:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jan Kneschke 2013-06-20 15:49:28 UTC
g_bytes_get_data()'s annotation of the return-value reads:

 * Returns: (transfer none) (array length=size) (type guint8): a pointer to the
 *          byte data

which leads to:

        <return-value transfer-ownership="none">
          <doc xml:whitespace="preserve">a pointer to the byte data</doc>
          <array length="0" zero-terminated="0" c:type="gconstpointer">
            <type name="guint8" c:type="gconstpointer"/>
          </array>
        </return-value>

where the <type ... c:type="gconstpointer" /> results in lgi reading 8-bytes instead of just 1, ending up in invalid reads.

https://github.com/pavouk/lgi/issues/57
Comment 1 André Klapper 2015-02-07 17:22:32 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 2 Mikhail Zabaluev 2015-10-01 22:19:36 UTC
A fix for the incorrect GIR result per se is submitted against glib source in bug #755961.

A remaining issue for gobject-introspection is that the inferred C type for array elements turns out wrong, possibly somehow transferred from the array's C type.
Comment 3 GNOME Infrastructure Team 2018-02-08 12:23:06 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/89.