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 695791 - Secret schema attribute lists not NULL-terminated
Secret schema attribute lists not NULL-terminated
Status: RESOLVED FIXED
Product: libsecret
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libsecret maintainer(s)
libsecret maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-03-13 17:51 UTC by Peter Bloomfield
Modified: 2013-03-14 05:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to remove quotation marks (1.32 KB, patch)
2013-03-13 17:51 UTC, Peter Bloomfield
none Details | Review

Description Peter Bloomfield 2013-03-13 17:51:44 UTC
Created attachment 238810 [details] [review]
Patch to remove quotation marks

Secret-schemas.c contains two predefined SecretSchemas, and secret-schema.c contains an example SecretSchema in a comment.  All three have arrays of SecretSchemaAttributes that are terminated with { "NULL", 0 }; that is, a SecretSchemaAttribute with name "NULL" and with type 0 (= SECRET_SCHEMA_ATTRIBUTE_STRING).

There doesn't seem to be any place in the code where this attribute is used as a sentinel; there are, however, tests for a NULL attribute name in secret_attributes_buildv and _secret_attributes_validate.

The name "NULL" seems to be most likely to be a typo; an attribute { NULL, 0 } would be consistent with the NULL sentinel required by va_arg processing, though not necessary in a statically allocated struct.  The code would be less confusing if the attribute were an unquoted { NULL, 0 }.

Patch attached.
Comment 1 Stef Walter 2013-03-14 05:55:44 UTC
Thanks for catching that. Appreciated.