summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2021-07-25 20:31:42 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2021-07-25 20:31:42 +0000
commitfb7346fd7b5159fbf5175ff32e452de122e5df3f (patch)
tree4bf2e8cec16b0e7ae4e7828ce6fd88728c69b7ee /usr.sbin/relayd
parent8ca10f335e8a26fb73863d0e8aa48215672ccc9a (diff)
The output of server_root_strip() is a string. Use the correct format
"%s". Same for the output of relay_expand_http(). with and ok claudio@ Found by Cedric Tessier, thanks!
Diffstat (limited to 'usr.sbin/relayd')
-rw-r--r--usr.sbin/relayd/relay_http.c6
-rw-r--r--usr.sbin/relayd/relayd.h8
2 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/relayd/relay_http.c b/usr.sbin/relayd/relay_http.c
index 29e401e0935..b1cfafd9718 100644
--- a/usr.sbin/relayd/relay_http.c
+++ b/usr.sbin/relayd/relay_http.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay_http.c,v 1.81 2021/03/24 20:59:54 benno Exp $ */
+/* $OpenBSD: relay_http.c,v 1.82 2021/07/25 20:31:41 benno Exp $ */
/*
* Copyright (c) 2006 - 2016 Reyk Floeter <reyk@openbsd.org>
@@ -1735,7 +1735,7 @@ relay_apply_actions(struct ctl_relay_event *cre, struct kvlist *actions,
case KEY_OPTION_STRIP:
nstrip = strtonum(kv->kv_value, 0, INT_MAX, NULL);
if (kv->kv_type == KEY_TYPE_PATH) {
- if (kv_setkey(match,
+ if (kv_setkey(match, "%s",
server_root_strip(match->kv_key,
nstrip)) == -1)
goto fail;
@@ -1763,7 +1763,7 @@ relay_apply_actions(struct ctl_relay_event *cre, struct kvlist *actions,
if ((ptr = relay_expand_http(cre, kp->kv_value, buf,
sizeof(buf))) == NULL)
goto fail;
- if (kv_set(match, ptr) == -1)
+ if (kv_set(match, "%s", ptr) == -1)
goto fail;
}
diff --git a/usr.sbin/relayd/relayd.h b/usr.sbin/relayd/relayd.h
index d83ec825aa2..2236d140f7e 100644
--- a/usr.sbin/relayd/relayd.h
+++ b/usr.sbin/relayd/relayd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayd.h,v 1.267 2021/04/20 21:11:56 dv Exp $ */
+/* $OpenBSD: relayd.h,v 1.268 2021/07/25 20:31:41 benno Exp $ */
/*
* Copyright (c) 2006 - 2016 Reyk Floeter <reyk@openbsd.org>
@@ -1353,8 +1353,10 @@ u_int32_t prefixlen2mask(u_int8_t);
int accept_reserve(int, struct sockaddr *, socklen_t *, int,
volatile int *);
struct kv *kv_add(struct kvtree *, char *, char *, int);
-int kv_set(struct kv *, char *, ...);
-int kv_setkey(struct kv *, char *, ...);
+int kv_set(struct kv *, char *, ...)
+ __attribute__((__format__ (printf, 2, 3)));
+int kv_setkey(struct kv *, char *, ...)
+ __attribute__((__format__ (printf, 2, 3)));
void kv_delete(struct kvtree *, struct kv *);
struct kv *kv_extend(struct kvtree *, struct kv *, char *);
void kv_purge(struct kvtree *);