summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/firewall-util.c5
-rw-r--r--src/shared/pager.c8
-rw-r--r--src/shared/path-lookup.c3
3 files changed, 10 insertions, 6 deletions
diff --git a/src/shared/firewall-util.c b/src/shared/firewall-util.c
index 9c29b0afca..952fc48c45 100644
--- a/src/shared/firewall-util.c
+++ b/src/shared/firewall-util.c
@@ -76,8 +76,11 @@ static int entry_fill_basics(
}
if (out_interface) {
+ size_t l = strlen(out_interface);
+ assert(l < sizeof entry->ip.outiface && l < sizeof entry->ip.outiface_mask);
+
strcpy(entry->ip.outiface, out_interface);
- memset(entry->ip.outiface_mask, 0xFF, strlen(out_interface)+1);
+ memset(entry->ip.outiface_mask, 0xFF, l + 1);
}
if (destination) {
entry->ip.dst = destination->in;
diff --git a/src/shared/pager.c b/src/shared/pager.c
index af667a83f4..f00ba9e1e7 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -104,7 +104,8 @@ int pager_open(bool no_pager, bool jump_to_end) {
less_opts = "FRSXMK";
if (jump_to_end)
less_opts = strjoina(less_opts, " +G");
- setenv("LESS", less_opts, 1);
+ if (setenv("LESS", less_opts, 1) < 0)
+ _exit(EXIT_FAILURE);
/* Initialize a good charset for less. This is
* particularly important if we output UTF-8
@@ -112,8 +113,9 @@ int pager_open(bool no_pager, bool jump_to_end) {
less_charset = getenv("SYSTEMD_LESSCHARSET");
if (!less_charset && is_locale_utf8())
less_charset = "utf-8";
- if (less_charset)
- setenv("LESSCHARSET", less_charset, 1);
+ if (less_charset &&
+ setenv("LESSCHARSET", less_charset, 1) < 0)
+ _exit(EXIT_FAILURE);
/* Make sure the pager goes away when the parent dies */
if (prctl(PR_SET_PDEATHSIG, SIGTERM) < 0)
diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c
index 09a44534e2..e2b3f8b742 100644
--- a/src/shared/path-lookup.c
+++ b/src/shared/path-lookup.c
@@ -520,8 +520,7 @@ int lookup_paths_init(
append = true;
}
- /* FIXME: empty components in other places should be
- * rejected. */
+ /* FIXME: empty components in other places should be rejected. */
r = path_split_and_make_absolute(e, &paths);
if (r < 0)