GNOME Bugzilla – Bug 695791
Secret schema attribute lists not NULL-terminated
Last modified: 2013-03-14 05:55: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.
Thanks for catching that. Appreciated.