aboutsummaryrefslogtreecommitdiffstats
path: root/src/faudit
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-11-27 10:36:49 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-11-27 10:36:49 -0500
commita4fd0e433ace4bbdafe808a56550d55431b882d2 (patch)
treeaaa1d2c0b3a45bd8c53411e628de7215f5ad34cb /src/faudit
parentMerge pull request #941 from Fred-Barclay/text_editors (diff)
downloadfirejail-a4fd0e433ace4bbdafe808a56550d55431b882d2.tar.gz
firejail-a4fd0e433ace4bbdafe808a56550d55431b882d2.tar.zst
firejail-a4fd0e433ace4bbdafe808a56550d55431b882d2.zip
fixes
Diffstat (limited to 'src/faudit')
-rw-r--r--src/faudit/dbus.c2
-rw-r--r--src/faudit/pid.c2
2 files changed, 1 insertions, 3 deletions
diff --git a/src/faudit/dbus.c b/src/faudit/dbus.c
index 4debf2ff6..d92660536 100644
--- a/src/faudit/dbus.c
+++ b/src/faudit/dbus.c
@@ -35,7 +35,7 @@ int check_unix(const char *sockfile) {
35 struct sockaddr_un remote; 35 struct sockaddr_un remote;
36 memset(&remote, 0, sizeof(struct sockaddr_un)); 36 memset(&remote, 0, sizeof(struct sockaddr_un));
37 remote.sun_family = AF_UNIX; 37 remote.sun_family = AF_UNIX;
38 strcpy(remote.sun_path, sockfile); 38 strncpy(remote.sun_path, sockfile, sizeof(remote.sun_path));
39 int len = strlen(remote.sun_path) + sizeof(remote.sun_family); 39 int len = strlen(remote.sun_path) + sizeof(remote.sun_family);
40 if (*sockfile == '@') 40 if (*sockfile == '@')
41 remote.sun_path[0] = '\0'; 41 remote.sun_path[0] = '\0';
diff --git a/src/faudit/pid.c b/src/faudit/pid.c
index a0fb1d921..84b23fe0a 100644
--- a/src/faudit/pid.c
+++ b/src/faudit/pid.c
@@ -46,7 +46,6 @@ void pid_test(void) {
46 /* coverity[toctou] */ 46 /* coverity[toctou] */
47 FILE *fp = fopen(fname, "r"); 47 FILE *fp = fopen(fname, "r");
48 if (!fp) { 48 if (!fp) {
49// fprintf(stderr, "Warning: cannot open %s\n", fname);
50 free(fname); 49 free(fname);
51 continue; 50 continue;
52 } 51 }
@@ -54,7 +53,6 @@ void pid_test(void) {
54 // read file 53 // read file
55 char buf[100]; 54 char buf[100];
56 if (fgets(buf, 10, fp) == NULL) { 55 if (fgets(buf, 10, fp) == NULL) {
57// fprintf(stderr, "Warning: cannot read %s\n", fname);
58 fclose(fp); 56 fclose(fp);
59 free(fname); 57 free(fname);
60 continue; 58 continue;