[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 philippe.desw...@jollamobile.com 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

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

2014-10-27 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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.

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

2014-10-24 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

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

2014-10-16 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

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

2014-10-16 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

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

2014-10-16 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

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

2014-10-16 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

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

2014-10-16 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

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

2014-09-28 Thread philippedeswert
From: Philippe De Swert philippe.desw...@jollamobile.com 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

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

2014-09-18 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

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

2014-09-18 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

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

2014-09-18 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

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

2014-09-16 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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(-)

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

2014-09-16 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

[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 philippedesw...@gmail.com 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

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

2014-09-13 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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 ---

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

2014-09-13 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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(+)

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

2014-09-12 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

[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 philippedesw...@gmail.com 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

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

2014-09-10 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

[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 philippedesw...@gmail.com 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

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

2014-09-10 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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:

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

2014-09-10 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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 philippedesw...@gmail.com --- src/libsystemd/sd-bus/bus-message.c | 6 +++--- 1 file

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

2014-09-10 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

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

2014-09-10 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com 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

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

2014-09-10 Thread philippedeswert
From: Philippe De Swert philippedesw...@gmail.com Found with Coverity. Signed-off-by: Philippe De Swert philippedesw...@gmail.com --- 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

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

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

[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 philippedesw...@gmail.com 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 philippedesw...@gmail.com --- src/test/test-util.c | 1 +