From ec013d45628b38f7be335d2e602776f576c50f67 Mon Sep 17 00:00:00 2001 From: claudio Date: Tue, 18 Oct 2022 14:03:39 +0000 Subject: [PATCH] Copy port to proxyport since the sting may point into memory that is freed. Should fix https://github.com/rpki-client/rpki-client-portable/issues/74 Reported by Ben Castricum OK tb@ --- usr.sbin/rpki-client/http.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/rpki-client/http.c b/usr.sbin/rpki-client/http.c index eef65af0751..f89a10f59c9 100644 --- a/usr.sbin/rpki-client/http.c +++ b/usr.sbin/rpki-client/http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: http.c,v 1.69 2022/09/20 08:53:27 claudio Exp $ */ +/* $OpenBSD: http.c,v 1.70 2022/10/18 14:03:39 claudio Exp $ */ /* * Copyright (c) 2020 Nils Fisher * Copyright (c) 2020 Claudio Jeker @@ -408,7 +408,8 @@ proxy_parse_uri(char *uri) if ((proxy.proxyhost = strdup(host)) == NULL) err(1, NULL); - proxy.proxyport = port; + if ((proxy.proxyport = strdup(port)) == NULL) + err(1, NULL); proxy.proxyauth = cookie; free(fullhost); -- 2.20.1