trace: check asprintf() return value
[project/procd.git] / jail / preload.c
index a1cc0b6..24358c6 100644 (file)
 
 #define _GNU_SOURCE
 #include <sys/types.h>
-#include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
 #include <dlfcn.h>
-#include <syslog.h>
 
 #include "seccomp.h"
 #include "../preload.h"
@@ -29,6 +27,11 @@ static int __preload_main__(int argc, char **argv, char **envp)
 {
        char *env_file = getenv("SECCOMP_FILE");
 
+       if (!env_file || !env_file[0]) {
+               ERROR("SECCOMP_FILE not specified\n");
+               return -1;
+       }
+
        if (install_syscall_filter(*argv, env_file))
                return -1;