[Toybox] [PATCH] Fix wget version concat segfault.

Denys Nykula nykula at ukr.net
Tue Feb 11 04:50:37 PST 2020


2b729ee missed sprintf destination for user agent version suffix?
---
>From 6d36d756c76770e38a35b0f1c81dbd5c9bef9f37 Mon Sep 17 00:00:00 2001
From: Denys Nykula <nykula at ukr.net>
Date: Tue, 11 Feb 2020 14:35:50 +0200
Subject: [PATCH] Fix wget version concat segfault.

---
 toys/pending/wget.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/toys/pending/wget.c b/toys/pending/wget.c
index 16672a2..21d4446 100644
--- a/toys/pending/wget.c
+++ b/toys/pending/wget.c
@@ -144,8 +144,7 @@ void wget_main(void)
   if(!toys.optargs[0]) help_exit("no URL");
   get_info(toys.optargs[0], hostname, port, path);

-
-  sprintf("/%s", TOYBOX_VERSION);
+  sprintf(ua+11, "/%s", TOYBOX_VERSION);
   for (;; redirects--) {
     sock = conn_svr(hostname, port);
     // compose HTTP request



More information about the Toybox mailing list