glib/gio/gvdb
Simon McVittie e5ed410c8c 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().

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=775510
Reviewed-by: Colin Walters
2016-12-02 19:10:39 +00:00
..
gvdb-builder.c Avoid calling Standard C string/array functions with NULL arguments 2016-12-02 19:10:39 +00:00
gvdb-builder.h Updated FSF's address 2014-01-31 14:31:55 +01:00
gvdb-format.h Updated FSF's address 2014-01-31 14:31:55 +01:00
gvdb-reader.c Updated FSF's address 2014-01-31 14:31:55 +01:00
gvdb-reader.h Updated FSF's address 2014-01-31 14:31:55 +01:00
gvdb.doap Merge remote branch 'gvdb/master' 2010-04-15 22:14:39 -04:00