diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-08-20 07:12:59 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-08-26 21:08:05 +0200 |
commit | 6028d4aa2df564f4f50cbaab96e5fdaa83996933 (patch) | |
tree | f0cef5d93e7a65977e6b9ba26373dde553ae22e8 /libiptc/libiptc.c | |
parent | 4ecdf8385bd05c25a3c991b1e409816c8eb82b77 (diff) |
libiptc: fix fortify errors in debug code
When using open(O_CREAT), you must supply the mode bits, otherwise the
func will pull random garbage off the stack.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'libiptc/libiptc.c')
-rw-r--r-- | libiptc/libiptc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index f0f78155..9c07bb40 100644 --- a/libiptc/libiptc.c +++ b/libiptc/libiptc.c @@ -1357,7 +1357,7 @@ retry: #ifdef IPTC_DEBUG2 { int fd = open("/tmp/libiptc-so_get_entries.blob", - O_CREAT|O_WRONLY); + O_CREAT|O_WRONLY, 0644); if (fd >= 0) { write(fd, h->entries, tmp); close(fd); @@ -2588,7 +2588,7 @@ TC_COMMIT(struct xtc_handle *handle) #ifdef IPTC_DEBUG2 { int fd = open("/tmp/libiptc-so_set_replace.blob", - O_CREAT|O_WRONLY); + O_CREAT|O_WRONLY, 0644); if (fd >= 0) { write(fd, repl, sizeof(*repl) + repl->size); close(fd); @@ -2664,7 +2664,7 @@ TC_COMMIT(struct xtc_handle *handle) #ifdef IPTC_DEBUG2 { int fd = open("/tmp/libiptc-so_set_add_counters.blob", - O_CREAT|O_WRONLY); + O_CREAT|O_WRONLY, 0644); if (fd >= 0) { write(fd, newcounters, counterlen); close(fd); |