chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
core: priorize notification fd processing over notification fd process via sd-event...
[elogind.git]
/
src
/
journal
/
journal-file.c
diff --git
a/src/journal/journal-file.c
b/src/journal/journal-file.c
index 4009b29b4603fbb92888d25fe84f82dffe543a68..b7e5cf0ab5bff9576aa74b2e155874f62e80612b 100644
(file)
--- 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;
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;
if (eq && eq > data) {
uint64_t fp;
Object *fo;
@@
-1625,8
+1628,6
@@
static int generic_array_bisect(
else
left = y + 1;
}
else
left = y + 1;
}
-
- last_index = (uint64_t) -1;
}
for (;;) {
}
for (;;) {
@@
-2730,7
+2731,8
@@
int journal_file_copy_entry(JournalFile *from, JournalFile *to, Object *o, uint6
ts.realtime = le64toh(o->entry.realtime);
n = journal_file_entry_n_items(o);
ts.realtime = le64toh(o->entry.realtime);
n = journal_file_entry_n_items(o);
- items = alloca(sizeof(EntryItem) * n);
+ /* alloca() can't take 0, hence let's allocate at least one */
+ items = alloca(sizeof(EntryItem) * MAX(1u, n));
for (i = 0; i < n; i++) {
uint64_t l, h;
for (i = 0; i < n; i++) {
uint64_t l, h;