[Privoxy-commits] [privoxy] 05/16: socks4_connect(): Fix the dstsize passed to strlcpy() in case of socks4a
User Git
git at git.privoxy.org
Thu Oct 9 11:51:27 CEST 2025
This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository privoxy.
commit b73d65ea904f50a5f00ccb3dff5fa66e515ca991
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Thu Sep 11 13:54:17 2025 +0200
socks4_connect(): Fix the dstsize passed to strlcpy() in case of socks4a
Previously we would substract sizeof(struct socks_op) twice
as it's already part of csiz. While this was wrong it didn't
cause any actual problems as the buffer size is so large that
it didn't matter.
Reported by: Joshua Rogers
---
gateway.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gateway.c b/gateway.c
index 7b0412dd..fc712915 100644
--- a/gateway.c
+++ b/gateway.c
@@ -875,7 +875,7 @@ static jb_socket socks4_connect(const struct forward_spec *fwd,
}
else
{
- strlcpy(buf + csiz, target_host, sizeof(buf) - sizeof(struct socks_op) - csiz);
+ strlcpy(buf + csiz, target_host, sizeof(buf) - csiz);
/*
* What we forward to the socks4a server should have the
* size of socks_op, plus the length of the userid plus
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Privoxy-commits
mailing list