[systemd-devel] [PATCH 5/6] coredumpctl: null check before dereferencing

Michal Sekletar msekleta at redhat.com
Thu Oct 25 07:16:18 PDT 2012


---
 src/journal/coredumpctl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index d15a31e..1a4d78f 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -222,6 +222,7 @@ static int retrieve(sd_journal *j, const char *name, const char **var) {
 
         field = strlen(name) + 1; // name + "="
         assert(len >= field);
+        assert(var);
 
         *var = strndup((const char*)data + field, len - field);
         if (!var)
-- 
1.7.11.7



More information about the systemd-devel mailing list