[systemd-devel] [PATCH] udev: Do not try to start worker if it cannot not recieve events

2014-11-18 Thread philippedeswert
From: Philippe De Swert udev_monitor_enable_receiving() enables a udev_monitor to recieve events. If this fails, the worker here created most likely won't recieve any events and will probably not be very useful. So now we check if the event recieving is activated before creating the new worker.

[systemd-devel] [PATCH] journal: avoid NULL pointer dereference in chain_cache_put

2014-10-27 Thread philippedeswert
From: Philippe De Swert ordered_hashmap_steal_first() can return NULL (and this is usually checked except here), so there is a potential NULL pointer reference. Thus moving the NULL check to cover both possible allocations of the ChainCacheItem. Found with coverity. Fixes: CID#1249723 --- src/j

[systemd-devel] [PATCH 2/5] libsystemd:terminal :fix uninitialized warning

2014-10-24 Thread philippedeswert
From: Philippe De Swert Remove the following warning during the compilation: src/libsystemd-terminal/grdev-drm.c: In function 'grdrm_card_hotplug': src/libsystemd-terminal/grdev-drm.c:1087:45: warning: 'fb' may be used uninitialized in this function [-Wmaybe-uninitialized] src/libsystemd-termina

[systemd-devel] [PATCH 1/5] journal : fix uninitialized var in coredump

2014-10-16 Thread philippedeswert
From: Philippe De Swert "Fix" the following warning: src/journal/coredump.c: In function ‘main’: src/journal/coredump.c:717:42: warning: ‘sz’ may be used uninitialized in this function [-Wmaybe-uninitialized] --- src/journal/coredump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[systemd-devel] [PATCH 4/5] shared:util : Remove shadow compile warning

2014-10-16 Thread philippedeswert
From: Philippe De Swert Removes the following compilation warning: src/shared/util.c: In function 'rm_rf_children_dangerous': src/shared/util.c:2800:22: warning: declaration of 'is_dir' shadows a global declaration [-Wshadow] In file included from src/shared/util.c:77:0: src/shared/mkdir.h:45:5:

[systemd-devel] [PATCH 5/5] test-strv : Fix shadowing compilation warning

2014-10-16 Thread philippedeswert
From: Philippe De Swert Remove the following warning during compilation: src/test/test-strv.c: In function ‘test_strv_quote_unquote’: src/test/test-strv.c:140:56: warning: declaration of ‘split’ shadows a global declaration [-Wshadow] In file included from src/test/test-strv.c:25:0: ./src/shared

[systemd-devel] [PATCH 0/5] Fix compiler warnings

2014-10-16 Thread philippedeswert
From: Philippe De Swert This patchset silences a number of compiler warnings. Most of them are more of a cosmetic nature, but can be useful anyway ;) Philippe De Swert (5): journal : fix uninitialized var in coredump libsystemd:terminal :fix uninitialized warning resolve: Remove implicit d

[systemd-devel] [PATCH 3/5] resolve: Remove implicit declaration

2014-10-16 Thread philippedeswert
From: Philippe De Swert Removes this compilation warning: src/resolve/resolved.c: In function ‘main’: src/resolve/resolved.c:49:9: warning: implicit declaration of function ‘label_init’ [-Wimplicit-function-declaration] src/resolve/resolved.c:49:9: warning: nested extern declaration of ‘label_in

[systemd-devel] [PATCH] bootchart: Do not try to access data for non-existing CPU's

2014-09-28 Thread philippedeswert
From: Philippe De Swert Cpu's are assigned normally, so starting at 0, so the MAX_CPU index will always be one smaller than the actual number. Found with Coverity. --- src/bootchart/store.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootchart/store.c b/src/bootchart

[systemd-devel] [PATCH 2/3] core: Remove uninitialized warnings from bus-endpoint.c

2014-09-18 Thread philippedeswert
From: Philippe De Swert Gcc is spewing some warnings about uninitialized variables. Let's get rid of the noise. --- src/core/bus-endpoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/bus-endpoint.c b/src/core/bus-endpoint.c index 1e8f07e..aac540d 100644 ---

[systemd-devel] [PATCH 1/3] journal-upload: Remove compilation warning

2014-09-18 Thread philippedeswert
From: Philippe De Swert When compiling we see this curl warning popping up: src/journal-remote/journal-upload.c:194:17: warning: call to ‘_curl_easy_setopt_err_error_buffer’ declared with attribute warning: curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option [ena

[systemd-devel] [PATCH 0/3] Minor patches for gcc warnings

2014-09-18 Thread philippedeswert
From: Philippe De Swert Hi, While compiling systemd I came across these warnings. And as I recompile a lot these days for Coverity they started to bug me and I just decided to fix them as they are quite trivial issues. Cheers! Philippe De Swert (3): journal-upload: Remove compilation warnin

[systemd-devel] [PATCH 3/3] sysusers: Remove some gcc warnings about uninitialized variables

2014-09-18 Thread philippedeswert
From: Philippe De Swert Gcc is spewing some warnings about uninitialized variables. Let's get rid of the noise. --- src/sysusers/sysusers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index ba20d94..4203b3e 100644 ---

[systemd-devel] [PATCH 1/3] journal: Do not count on the compiler initializing found_last to false

2014-09-16 Thread philippedeswert
From: Philippe De Swert There is a very unlikely case where this can happen since gcc usually does the sane thing. But let's make sure found_last is initialized anyway. Fixes: CID#996386 --- src/journal/journal-verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jou

[systemd-devel] [PATCH 3/3] util : Remove dead code

2014-09-16 Thread philippedeswert
From: Philippe De Swert We only break out of the pre-ceding loop into the rest of the code if fd is actually >= 0. So the < 0 check will never be true and not necessary. Found with Coverity. Fixes: CID#1237577 --- src/shared/util.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/share

[systemd-devel] [PATCH 2/3] [RFC]sd-bus: remove some dead code

2014-09-16 Thread philippedeswert
From: Philippe De Swert The r < 0 test has been done before we reach it in the loop, and we returned out of the function. So this cannot be reached. But it could actually be that something is missing. --- src/libsystemd/sd-bus/bus-objects.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sr

[systemd-devel] [RFC][PATCH 2/2] terminal: handle term_utf8_decode returning NULL

2014-09-13 Thread philippedeswert
From: Philippe De Swert term_utf8_decode can return NULL. We definitely do not want to dereference ucs4_str in case this happens. Not really sure on what to return or handle this though. --- src/libsystemd-terminal/term-screen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libsystem

[systemd-devel] [RFC][PATCH 1/2] resolve: resolved-manager: Avoid null dereference

2014-09-13 Thread philippedeswert
From: Philippe De Swert hashmap_get can return null, so as we dereference it immediately after calling it, we could crash. It is unlikely to occur though I expect. I am however unsure what error should be reported (if at all). Coverity CID#1237656 --- src/resolve/resolved-manager.c | 2 ++ 1 fi

[systemd-devel] [PATCH] core: smack-setup: Actually allow for succesfully loading CIPSO policy

2014-09-12 Thread philippedeswert
From: Philippe De Swert The line under the last switch statement *loaded_policy = true; would never be executed. As all switch cases return 0. Thus the policy would never be marked as loaded. Found with Coverity. Fixes: CID#1237785 --- src/core/smack-setup.c | 2 +- 1 file changed, 1 insertion

[systemd-devel] [PATCH 1/3] [file handle leak] Close file handle when we're done with it

2014-09-10 Thread philippedeswert
From: Philippe De Swert In test_read_one_char the filehandle does not get its fclose at the end of the function, thus we are leaking fd's. Found with Coverity. Fixes: CID#1237749 Signed-off-by: Philippe De Swert --- src/test/test-util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/

[systemd-devel] [PATCH 2/3] [fd leak] Stop leaking an fd in sd_journal_sendv

2014-09-10 Thread philippedeswert
From: Philippe De Swert Found with Coverity. Fixes: CID#996435 Signed-off-by: Philippe De Swert --- src/journal/journal-send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c index bb1ef66..b7cc4bd 100644 --- a/src/jou

[systemd-devel] [PATCH 3/3] [fd leak] Stop leaking fd in do_accept()

2014-09-10 Thread philippedeswert
From: Philippe De Swert Found with Coverity. Signed-off-by: Philippe De Swert --- src/activate/activate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/activate/activate.c b/src/activate/activate.c index 8942773..0a1df37 100644 --- a/src/activate/activate.c +++ b/src/

[systemd-devel] [PATCH 0/3] More coverity error fixes

2014-09-10 Thread philippedeswert
From: Philippe De Swert Hi all, Here are some more Coverity fixes. More in line with what I learned today on the mailing list about the use of gcc macros. Cheers, Philippe Philippe De Swert (3): [file handle leak] Close file handle when we're done with it [fd leak] Stop leaking an fd in

[systemd-devel] [PATCH 1/5] [use after free] Avoid using m->kdbus after freeing it.

2014-09-10 Thread philippedeswert
From: Philippe De Swert m->kdbus could be freed before it is released. Changing the order fixes the issue. Found with Coverity. Fixes: CID#1237798 Signed-off-by: Philippe De Swert --- src/libsystemd/sd-bus/bus-message.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[systemd-devel] [PATCH 4/5] [memleak] Do not leak mmapped area when other memory allocations fail.

2014-09-10 Thread philippedeswert
From: Philippe De Swert After a section of memory is succesfully allocated, some of the following actions can still fail due to lack of memory. In this case -ENOMEM is returned without actually freeing the already mapped memory. Found with coverity. Fixes: CID#1237762 Signed-off-by: Philippe De

[systemd-devel] [PATCH 5/5] [memleak] Actually unref the buscreds on failure.

2014-09-10 Thread philippedeswert
From: Philippe De Swert Actually unref the buscreds when we are not going to return a pointer to them. As when bus_creds_add_more fails we immediately return the error code otherwise and leak the new buscreds. Found with coverity. Fixes: CID#1237761 Signed-off-by: Philippe De Swert --- src/lib

[systemd-devel] [PATCH 3/5] [uninitialized] No need to check if num is < 0

2014-09-10 Thread philippedeswert
From: Philippe De Swert When num is < 0 we jump to the error handling. However at that time r is not set yet by keyboard_fill so we most likely get a nonsensical error. However the num check is not needed as the xkb_state_key_get_syms will not return negative values. From its documentation: @retu

[systemd-devel] [PATCH 2/5] [use after free] pattern is already freed, so do not dereference it in the error print

2014-09-10 Thread philippedeswert
From: Philippe De Swert In case set_consume goes wrong, the pattern name has already been freed. So we do not try to print it in the logs, assuming the pattern addition print will be printed just before the failure anyway. Found with coverity. Fixes: CID#1237798 Signed-off-by: Philippe De Swert

[systemd-devel] [PATCH 0/5] Coverity fixes

2014-09-10 Thread philippedeswert
From: Philippe De Swert Hi, Yesterday I finally got to revive the systemd Coverity project on scan.coverity.org Unfortunately to see the errors reported you need to sign up, but I will make sure to approve requests for seeing the "bugs" whenever they show up. Also I quickly made some quick fixe