[systemd-commits] 2 commits - Makefile.am src/journal
Zbigniew JÄdrzejewski-Szmek
zbyszek at kemper.freedesktop.org
Mon Dec 16 20:59:24 PST 2013
Makefile.am | 3 +++
src/journal/journal-file.c | 5 ++++-
2 files changed, 7 insertions(+), 1 deletion(-)
New commits:
commit e7335f549182233c80fed5dcedeade6d64ed354b
Author: Zbigniew JÄdrzejewski-Szmek <zbyszek at in.waw.pl>
Date: Mon Dec 16 23:58:51 2013 -0500
build-sys: fix distcheck
diff --git a/Makefile.am b/Makefile.am
index 6c30a05..de63054 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2050,6 +2050,9 @@ EXTRA_DIST += \
src/libsystemd-bus/DIFFERENCES \
src/libsystemd-bus/GVARIANT-SERIALIZATION
+CLEANFILES += \
+ src/libsystemd-bus/bus-error-mapping.c
+
lib_LTLIBRARIES += \
libsystemd-bus.la
commit 08c6f819cb0ed435649583da02fa0de965b32dbe
Author: Shawn Landden <shawn at churchofgit.com>
Date: Mon Dec 16 15:41:00 2013 -0800
journal: fix against (theoretical) undefined behavior
While all the libc implementations I know return NULL when memchr's size
parameter is 0, without accessing any memory, passing NULL to memchr is
still invalid:
C11 7.24.1p2: Where an argument declared as "size_t n" specifies the length
of the array for a function, n can have the value zero on a call to that
function. Unless explicitly stated otherwise in the description of a
particular function in this subclause, pointer arguments on such a call
shall still have valid values, as described in 7.1.4. On such a call, a
function that locates a character finds no occurrence, a function that
compares two character sequences returns zero, and a function that copies
characters copies zero characters.
see http://llvm.org/bugs/show_bug.cgi?id=18247
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 48fdb61..9e89cb9 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -1010,7 +1010,10 @@ static int journal_file_append_data(
if (r < 0)
return r;
- eq = memchr(data, '=', size);
+ if (!data)
+ eq = NULL;
+ else
+ eq = memchr(data, '=', size);
if (eq && eq > data) {
uint64_t fp;
Object *fo;
More information about the systemd-commits
mailing list