From: Matej Habrnal Date: Mon, 26 Sep 2016 15:28:58 +0000 (+0200) Subject: coredump: initialize coredump_size in submit_coredump() (#4219) X-Git-Tag: v234~1055 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5ca3649d34c5649ca04fc81000a80e476a81a64;p=platform%2Fupstream%2Fsystemd.git coredump: initialize coredump_size in submit_coredump() (#4219) If ulimit is smaller than page_size(), function save_external_coredump() returns -EBADSLT and this causes skipping whole core dumping part in submit_coredump(). Initializing coredump_size to UINT64_MAX prevents evaluating a condition with uninitialized varialbe which leads to calling allocate_journal_field() with coredump_fd = -1 which causes aborting. Signed-off-by: Matej Habrnal --- diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index 9dea10b..7cc3f3f 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -678,7 +678,7 @@ static int submit_coredump( _cleanup_close_ int coredump_fd = -1, coredump_node_fd = -1; _cleanup_free_ char *core_message = NULL, *filename = NULL, *coredump_data = NULL; - uint64_t coredump_size; + uint64_t coredump_size = UINT64_MAX; int r; assert(context);