aboutsummaryrefslogtreecommitdiff
path: root/src/Proxy
diff options
context:
space:
mode:
authorfrosty <frostinator33@airmail.cc>2026-10-27 20:31:28 -0400
committerfrosty <frostinator33@airmail.cc>2026-10-27 20:33:50 -0400
commit250898c638f07ace6bc7167faede93113c8fd0db (patch)
tree310addbedcaaf76da98df22434a4f4711c8ba963 /src/Proxy
parentbd3da2232540ea4c78e7ac35e2c90c38c8a3c410 (diff)
refactor: replace potentially unsafe string functions with snprintf
Diffstat (limited to 'src/Proxy')
-rw-r--r--src/Proxy/Proxy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Proxy/Proxy.c b/src/Proxy/Proxy.c
index 5205bac..15e5b1c 100644
--- a/src/Proxy/Proxy.c
+++ b/src/Proxy/Proxy.c
@@ -25,8 +25,7 @@ static void generate_random_string(char *buf, size_t len) {
void set_proxy_config(const char *proxy_str, int rand_user, int rand_pass) {
if (proxy_str && proxy_str[0]) {
- strncpy(proxy_url, proxy_str, sizeof(proxy_url) - 1);
- proxy_url[sizeof(proxy_url) - 1] = '\0';
+ snprintf(proxy_url, sizeof(proxy_url), "%s", proxy_str);
}
randomize_username = rand_user;
randomize_password = rand_pass;
@@ -144,7 +143,8 @@ int load_proxy_list(const char *filename) {
if (temp_count >= temp_capacity) {
temp_capacity *= 2;
- Proxy *new_list = (Proxy *)realloc(temp_list, temp_capacity * sizeof(Proxy));
+ Proxy *new_list =
+ (Proxy *)realloc(temp_list, temp_capacity * sizeof(Proxy));
if (!new_list) {
free(temp_list);
fclose(file);