chiark / gitweb /
coredumpctl: fix potential deref of null pointer
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Thu, 26 Jun 2014 22:17:22 +0000 (00:17 +0200)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Thu, 26 Jun 2014 22:17:58 +0000 (00:17 +0200)
src/journal/coredumpctl.c

index 5a6c897..2158d73 100644 (file)
@@ -601,8 +601,10 @@ static int save_core(sd_journal *j, int fd, char **path, bool *unlink_temp) {
         }
 
         if (filename && !endswith(filename, ".xz")) {
-                *path = filename;
-                filename = NULL;
+                if (path) {
+                        *path = filename;
+                        filename = NULL;
+                }
 
                 return 0;
         } else {