board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / wget / 0001-Fix-CRLF-injection-in-Wget-host-part.patch
blob380b075244acad46c04db1499046949bd4d406c7
1 From 4d729e322fae359a1aefaafec1144764a54e8ad4 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
3 Date: Mon, 6 Mar 2017 10:04:22 +0100
4 Subject: [PATCH] Fix CRLF injection in Wget host part
6 * src/url.c (url_parse): Reject control characters in host part of URL
8 Reported-by: Orange Tsai
9 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
10 ---
11 Patch status: upstream commit 4d729e322fae35
13 src/url.c | 11 +++++++++++
14 1 file changed, 11 insertions(+)
16 diff --git a/src/url.c b/src/url.c
17 index 8f8ff0b881af..7d36b27d7b92 100644
18 --- a/src/url.c
19 +++ b/src/url.c
20 @@ -925,6 +925,17 @@ url_parse (const char *url, int *error, struct iri *iri, bool percent_encode)
21 url_unescape (u->host);
22 host_modified = true;
24 + /* check for invalid control characters in host name */
25 + for (p = u->host; *p; p++)
26 + {
27 + if (c_iscntrl(*p))
28 + {
29 + url_free(u);
30 + error_code = PE_INVALID_HOST_NAME;
31 + goto error;
32 + }
33 + }
35 /* Apply IDNA regardless of iri->utf8_encode status */
36 if (opt.enable_iri && iri)
38 --
39 2.11.0