From 355228121e7656b1c48fd96fa4bcccc0d14161ae Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 13 Aug 2018 14:29:51 +0100 Subject: doap: Update maintainers list to synchronise with GLib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GVDB is essentially part of GLib, so should have the same maintainer list. At least this way, it’s not just maintained by one absentee maintainer. Signed-off-by: Philip Withnall --- gvdb.doap | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/gvdb.doap b/gvdb.doap index b4ae60c..8c5f3e8 100644 --- a/gvdb.doap +++ b/gvdb.doap @@ -23,9 +23,34 @@ - Ryan Lortie - - ryanl + Matthias Clasen + + matthiasc + + + + + + Allison Ryan Lortie + + desrt + + + + + + Philip Withnall + + + pwithnall + + + + + + Emmanuele Bassi + + ebassi -- cgit v1.2.1 From 7fd9f61dbdbe4b0a05c7c66267f06119a16e869a Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 13 Aug 2018 14:13:28 +0100 Subject: Avoid calling Standard C string/array functions with NULL arguments glibc string.h declares memcpy() with attribute(nonnull(1,2)), causing calls with NULL arguments to be treated as undefined behaviour. This is consistent with ISO C99 and C11, which state that passing 0 to string functions as an array length does not remove the requirement that the pointer to the array is a valid pointer. gcc -fsanitize=undefined catches this while running OSTree's test suite. Similarly, running the GLib test suite reports similar issues for qsort(), memmove(), memcmp(). (This is a partial cherry-pick of commit e5ed410c8c0fe823883 from GLib.) Signed-off-by: Simon McVittie Bug: https://bugzilla.gnome.org/show_bug.cgi?id=775510 Reviewed-by: Colin Walters --- gvdb-builder.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gvdb-builder.c b/gvdb-builder.c index c63d117..0618768 100644 --- a/gvdb-builder.c +++ b/gvdb-builder.c @@ -293,7 +293,8 @@ file_builder_add_string (FileBuilder *fb, chunk->offset = fb->offset; chunk->size = length; chunk->data = g_malloc (length); - memcpy (chunk->data, string, length); + if (length != 0) + memcpy (chunk->data, string, length); *start = guint32_to_le (fb->offset); *size = guint16_to_le (length); -- cgit v1.2.1 From 4763db8a4c4a4f8e4fcfc9aefda082b273978a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Wilmet?= Date: Fri, 26 May 2017 16:08:19 +0200 Subject: gio/gvdb/: LGPLv2+ -> LGPLv2.1+ https://bugzilla.gnome.org/show_bug.cgi?id=776504 --- gvdb-builder.c | 2 +- gvdb-builder.h | 2 +- gvdb-format.h | 2 +- gvdb-reader.c | 2 +- gvdb-reader.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gvdb-builder.c b/gvdb-builder.c index 0618768..ea1c76f 100644 --- a/gvdb-builder.c +++ b/gvdb-builder.c @@ -4,7 +4,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the licence, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/gvdb-builder.h b/gvdb-builder.h index 797626e..edbaac2 100644 --- a/gvdb-builder.h +++ b/gvdb-builder.h @@ -4,7 +4,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the licence, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/gvdb-format.h b/gvdb-format.h index 886aa56..d02a2eb 100644 --- a/gvdb-format.h +++ b/gvdb-format.h @@ -4,7 +4,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the licence, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/gvdb-reader.c b/gvdb-reader.c index 8ccfc8f..eb7a11c 100644 --- a/gvdb-reader.c +++ b/gvdb-reader.c @@ -4,7 +4,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the licence, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/gvdb-reader.h b/gvdb-reader.h index 5980925..7113eb3 100644 --- a/gvdb-reader.h +++ b/gvdb-reader.h @@ -4,7 +4,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the licence, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of -- cgit v1.2.1 From c78664e101cd46e10d59be83703ade46b5d4c8e5 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 13 Aug 2018 14:22:53 +0100 Subject: =?UTF-8?q?Update=20FSF=E2=80=99s=20address?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (This is based on commit 892fc2e4 from dconf.) Signed-off-by: Philip Withnall --- gvdb-builder.c | 4 +--- gvdb-builder.h | 4 +--- gvdb-format.h | 4 +--- gvdb-reader.c | 4 +--- gvdb-reader.h | 4 +--- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/gvdb-builder.c b/gvdb-builder.c index ea1c76f..2383e60 100644 --- a/gvdb-builder.c +++ b/gvdb-builder.c @@ -12,9 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library; if not, see . * * Author: Ryan Lortie */ diff --git a/gvdb-builder.h b/gvdb-builder.h index edbaac2..b4815f0 100644 --- a/gvdb-builder.h +++ b/gvdb-builder.h @@ -12,9 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library; if not, see . * * Author: Ryan Lortie */ diff --git a/gvdb-format.h b/gvdb-format.h index d02a2eb..ed6adab 100644 --- a/gvdb-format.h +++ b/gvdb-format.h @@ -12,9 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library; if not, see . * * Author: Ryan Lortie */ diff --git a/gvdb-reader.c b/gvdb-reader.c index eb7a11c..bc4de09 100644 --- a/gvdb-reader.c +++ b/gvdb-reader.c @@ -12,9 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library; if not, see . * * Author: Ryan Lortie */ diff --git a/gvdb-reader.h b/gvdb-reader.h index 7113eb3..3982773 100644 --- a/gvdb-reader.h +++ b/gvdb-reader.h @@ -12,9 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library; if not, see . * * Author: Ryan Lortie */ -- cgit v1.2.1 From d2f0461ec0e548ab659d247599846d16741a1e5d Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 13 Aug 2018 14:27:07 +0100 Subject: =?UTF-8?q?docs:=20Use=20=E2=80=98Returns:=E2=80=99=20instead=20of?= =?UTF-8?q?=20the=20invalid=20=E2=80=98@returns=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is based on the commit 59a24ab5a3 in GLib. Signed-off-by: Philip Withnall --- gvdb-reader.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/gvdb-reader.c b/gvdb-reader.c index bc4de09..1ec6633 100644 --- a/gvdb-reader.c +++ b/gvdb-reader.c @@ -125,7 +125,6 @@ gvdb_table_setup_root (GvdbTable *file, * @bytes: the #GBytes with the data * @trusted: if the contents of @bytes are trusted * @error: %NULL, or a pointer to a %NULL #GError - * @returns: a new #GvdbTable * * Creates a new #GvdbTable from the contents of @bytes. * @@ -133,6 +132,8 @@ gvdb_table_setup_root (GvdbTable *file, * * You should call gvdb_table_free() on the return result when you no * longer require it. + * + * Returns: a new #GvdbTable **/ GvdbTable * gvdb_table_new_from_bytes (GBytes *bytes, @@ -184,10 +185,11 @@ invalid: * @filename: a filename * @trusted: if the contents of @bytes are trusted * @error: %NULL, or a pointer to a %NULL #GError - * @returns: a new #GvdbTable * * Creates a new #GvdbTable using the #GMappedFile for @filename as the * #GBytes. + * + * Returns: a new #GvdbTable **/ GvdbTable * gvdb_table_new (const gchar *filename, @@ -474,7 +476,6 @@ gvdb_table_get_names (GvdbTable *table, * gvdb_table_list: * @file: a #GvdbTable * @key: a string - * @returns: a %NULL-terminated string array * * List all of the keys that appear below @key. The nesting of keys * within the hash file is defined by the program that created the hash @@ -487,6 +488,8 @@ gvdb_table_get_names (GvdbTable *table, * * You should call g_strfreev() on the return result when you no longer * require it. + * + * Returns: a %NULL-terminated string array **/ gchar ** gvdb_table_list (GvdbTable *file, @@ -537,12 +540,13 @@ gvdb_table_list (GvdbTable *file, * gvdb_table_has_value: * @file: a #GvdbTable * @key: a string - * @returns: %TRUE if @key is in the table * * Checks for a value named @key in @file. * * Note: this function does not consider non-value nodes (other hash * tables, for example). + * + * Returns: %TRUE if @key is in the table **/ gboolean gvdb_table_has_value (GvdbTable *file, @@ -586,7 +590,6 @@ gvdb_table_value_from_item (GvdbTable *table, * gvdb_table_get_value: * @file: a #GvdbTable * @key: a string - * @returns: a #GVariant, or %NULL * * Looks up a value named @key in @file. * @@ -596,6 +599,8 @@ gvdb_table_value_from_item (GvdbTable *table, * * You should call g_variant_unref() on the return result when you no * longer require it. + * + * Returns: a #GVariant, or %NULL **/ GVariant * gvdb_table_get_value (GvdbTable *file, @@ -625,12 +630,13 @@ gvdb_table_get_value (GvdbTable *file, * gvdb_table_get_raw_value: * @table: a #GvdbTable * @key: a string - * @returns: a #GVariant, or %NULL * * Looks up a value named @key in @file. * * This call is equivalent to gvdb_table_get_value() except that it * never byteswaps the value. + * + * Returns: a #GVariant, or %NULL **/ GVariant * gvdb_table_get_raw_value (GvdbTable *table, @@ -648,7 +654,6 @@ gvdb_table_get_raw_value (GvdbTable *table, * gvdb_table_get_table: * @file: a #GvdbTable * @key: a string - * @returns: a new #GvdbTable, or %NULL * * Looks up the hash table named @key in @file. * @@ -662,6 +667,8 @@ gvdb_table_get_raw_value (GvdbTable *table, * * You should call gvdb_table_free() on the return result when you no * longer require it. + * + * Returns: a new #GvdbTable, or %NULL **/ GvdbTable * gvdb_table_get_table (GvdbTable *file, @@ -703,13 +710,14 @@ gvdb_table_free (GvdbTable *file) /** * gvdb_table_is_valid: * @table: a #GvdbTable - * @returns: %TRUE if @table is still valid * * Checks if the table is still valid. * * An on-disk GVDB can be marked as invalid. This happens when the file * has been replaced. The appropriate action is typically to reopen the * file. + * + * Returns: %TRUE if @table is still valid **/ gboolean gvdb_table_is_valid (GvdbTable *table) -- cgit v1.2.1 From 57962aac85a41f554e14da14906a3ba0bd8f9156 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 13 Aug 2018 14:27:46 +0100 Subject: docs: Clarify error values for empty files when loading Signed-off-by: Philip Withnall --- gvdb-reader.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gvdb-reader.c b/gvdb-reader.c index 1ec6633..aa3154f 100644 --- a/gvdb-reader.c +++ b/gvdb-reader.c @@ -128,7 +128,8 @@ gvdb_table_setup_root (GvdbTable *file, * * Creates a new #GvdbTable from the contents of @bytes. * - * This call can fail if the header contained in @bytes is invalid. + * This call can fail if the header contained in @bytes is invalid or if @bytes + * is empty; if so, %G_FILE_ERROR_INVAL will be returned. * * You should call gvdb_table_free() on the return result when you no * longer require it. @@ -189,6 +190,12 @@ invalid: * Creates a new #GvdbTable using the #GMappedFile for @filename as the * #GBytes. * + * This function will fail if the file cannot be opened. + * In that case, the #GError that is returned will be an error from + * g_mapped_file_new(). + * + * An empty or corrupt file will result in %G_FILE_ERROR_INVAL. + * * Returns: a new #GvdbTable **/ GvdbTable * -- cgit v1.2.1 From 8578acafd519448f38601026a58dbfdbeb03a72f Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 13 Aug 2018 14:39:43 +0100 Subject: docs: Update gvdb merge documentation Signed-off-by: Philip Withnall Reviewed-by: nobody --- gvdb/README | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gvdb/README b/gvdb/README index 94e6c5d..4dbd697 100644 --- a/gvdb/README +++ b/gvdb/README @@ -1,7 +1,12 @@ DO NOT MODIFY ANY FILE IN THIS DIRECTORY -(except maybe the Makefile.am) +(except maybe the meson.build) This directory is the result of a git subtree merge with the 'gvdb' -module on git.gnome.org. Please apply fixes to the 'gvdb' module and -perform a git merge. +module on gitlab.gnome.org. Please apply fixes to the 'gvdb' module and +perform a git merge: + +git remote add gvdb git@gitlab.gnome.org:GNOME/gvdb.git +git remote update gvdb +cd gvdb/ +git merge gvdb/master \ No newline at end of file -- cgit v1.2.1