Bug#563872: Bug: #563872: wget segfaults when server returns empty HTTP response code

2010-02-02 Thread Noèl Köthe
tags 563872 + confirmed upstream
forwarded 563872 https://savannah.gnu.org/bugs/index.php?28793
thanks

Hello Raphael,

Am Mittwoch, den 27.01.2010, 19:08 -0600 schrieb Raphael Geissert:

 The attached patch fixes it. wget was trying to copy a string referenced by a 
 NULL pointer.
 
 Now the output is:
 
 --2010-01-27 19:02:20--  http://localhost:1234/
 Resolving localhost (localhost)... ::1, 127.0.0.1
 Connecting to localhost (localhost)|::1|:1234... failed: Connection refused.
 Connecting to localhost (localhost)|127.0.0.1|:1234... connected.
 HTTP request sent, awaiting response... -1
 2010-01-27 19:02:20 ERROR -1: Malformed status line.

Thanks for the patch. I forwarded it to upstream.

-- 
Noèl Köthe noel debian.org
Debian GNU/Linux, www.debian.org


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


Bug#563872: Bug: #563872: wget segfaults when server returns empty HTTP response code

2010-01-27 Thread Raphael Geissert
tag 563872 patch
thanks

The attached patch fixes it. wget was trying to copy a string referenced by a 
NULL pointer.

Now the output is:

--2010-01-27 19:02:20--  http://localhost:1234/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:1234... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:1234... connected.
HTTP request sent, awaiting response... -1
2010-01-27 19:02:20 ERROR -1: Malformed status line.

Cheers,
-- 
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net
--- wget-1.12.orig/src/http.c
+++ wget-1.12/src/http.c
@@ -1829,7 +1829,8 @@
   /* Check for status line.  */
   message = NULL;
   statcode = resp_status (resp, message);
-  hs-message = xstrdup (message);
+  if (message)
+hs-message = xstrdup (message);
   if (!opt.server_response)
 logprintf (LOG_VERBOSE, %2d %s\n, statcode,
message ? quotearg_style (escape_quoting_style, message) : );


signature.asc
Description: This is a digitally signed message part.