Re: HTTP parse_html null target

"R. Wajda" <[email protected]> Wed, 02 Jan 2008 10:54:24 +0100
Newsgroups gmane.network.lftp.devel
Message-ID <[email protected]>
Dear lftp-devel list,

first patch fixed only one specific NULL-pointer case, v2 patch fixes
several.

Regards,
RW
lftp_http_null_target_v2.patch (text/plain, 655 B)
--- HttpDir.cc_3.6.1	2008-01-02 10:12:50.000000000 +0100
+++ HttpDir.cc	2008-01-02 10:49:15.000000000 +0100
@@ -691,6 +691,9 @@
    if(tag_scan->tag==0)
       return tag_len;	// not interesting
 
+   if(link_target.length()==0)
+      return tag_len;   // no target ?
+
    const char *prefix_proto=0;
    if(prefix)
       prefix_proto=prefix->proto;
@@ -766,8 +769,6 @@
    if(strchr(link_target,'?'))
       return tag_len;	// cgi
    link_target.truncate_at('#'); // strip the anchor
-   if(link_target.length()==0)
-      return tag_len;	// no target ?
 
    // netscape internal icons
    if(icon && !strncasecmp(link_target,"internal-gopher",15))