diff options
author | Richard Hughes <richard@hughsie.com> | 2013-11-28 14:40:32 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2013-11-28 14:40:32 +0000 |
commit | 42ede85a268a5d8e5453a53c0577c5e2e3cdb5d3 (patch) | |
tree | 45866cdb12e4bc0f04eccc805dcd726f52677962 /lib | |
parent | ca16203d98f3699c50a56fb47679d53c01728e64 (diff) | |
download | colord-42ede85a268a5d8e5453a53c0577c5e2e3cdb5d3.tar.gz |
libcolord: Check that both the metadata key and value are valid UTF-8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/colord/cd-icc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/colord/cd-icc.c b/lib/colord/cd-icc.c index e2b5047..398dd89 100644 --- a/lib/colord/cd-icc.c +++ b/lib/colord/cd-icc.c @@ -2442,7 +2442,7 @@ cd_icc_get_metadata_item (CdIcc *icc, const gchar *key) * cd_icc_add_metadata: * @icc: A valid #CdIcc * @key: the metadata key - * @value: the metadata value + * @value: the UTF-8 metadata value * * Sets an item of data to the profile metadata, overwriting it if * it already exists. @@ -2454,7 +2454,9 @@ cd_icc_add_metadata (CdIcc *icc, const gchar *key, const gchar *value) { g_return_if_fail (CD_IS_ICC (icc)); g_return_if_fail (key != NULL); + g_return_if_fail (g_utf8_validate (key, -1, NULL)); g_return_if_fail (value != NULL); + g_return_if_fail (g_utf8_validate (value, -1, NULL)); g_hash_table_insert (icc->priv->metadata, g_strdup (key), g_strdup (value)); |