bugGNU Wget - Bugs: bug #42195, Content encoding string leaked

 
 

bug #42195: Content encoding string leaked

Submitted by:  None
Submitted on:  Fri 25 Apr 2014 11:27:25 AM UTC  
 
Category: Memory LeakSeverity: 2 - Minor
Priority: 5 - NormalStatus: Fixed
Privacy: PublicAssigned to: None
Originator Name: Benjamin GooseOriginator Email: -unavailable-
Open/Closed: ClosedRelease: trunk
Operating System: GNU/LinuxReproducibility: Every Time
Fixed Release: NonePlanned Release: None
Regression: NoneWork Required: None
Patch Included: Yes

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 02 May 2014 06:47:29 PM UTC, comment #2:

Thanks for the reply. A new patch is attached.

(file #31299)

Anonymous
Thu 01 May 2014 07:58:17 AM UTC, comment #1:

Hi,

Thanks for the report. The string indeed seems to be leaking.
But there's a couple of comments:

@@ -2596,6 +2596,7 @@ read_header:
tmp = parse_charset (tmp2);
if (tmp)
set_content_encoding (iri, tmp);
+ xfree_null(tmp);
}
}
}

This patch seems ripe for the same kind of bug as apple goto fail in SSL. You've indented code at the same level as an if statement, even though it is not part of the conditional.

Also, would it not be better to free the pointer just outside of the if(tmp) {} block?

Could you please also write a ChangeLog entry for this so we can push it?

Darshit Shah <darnir>
Project Member
Fri 25 Apr 2014 11:27:25 AM UTC, original submission:
  • http.c:2596: parse_charset returns a pointer to a newly allocated string (with strdupdelim)
  • This is passed to set_content_encoding, which uses xstrdup to copy it again
  • The original string is not freed.
Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #31299:  0001-Plug-memory-leak-2.patch added by None (887B - text/x-patch)
file #31246:  0001-Plug-memory-leak.patch added by None (575B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by darnir (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 08 Jun 2014 02:32:39 PM UTCdarnirOpen/ClosedOpen=>Closed
    Fri 09 May 2014 10:56:49 PM UTCdarnirStatusConfirmed=>Fixed
    Fri 02 May 2014 06:47:29 PM UTCNoneAttached File-=>Added 0001-Plug-memory-leak-2.patch, #31299
    Thu 01 May 2014 07:58:17 AM UTCdarnirSeverity3 - Normal=>2 - Minor
      StatusNone=>Confirmed
    Fri 25 Apr 2014 11:27:26 AM UTCNoneAttached File-=>Added 0001-Plug-memory-leak.patch, #31246

    Back to the top


    Powered by Savane 3.1-cleanup