Bug 161701
Summary: | jcf-dump free() misusage | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Colin Walters <walters> | ||||
Component: | gcc | Assignee: | Tom Tromey <tromey> | ||||
Status: | CLOSED INSUFFICIENT_DATA | QA Contact: | |||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | rawhide | CC: | jakub, patrickm, triage, tromey | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | bzcl34nup | ||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2008-05-07 00:11:58 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Colin Walters
2005-06-26 01:26:55 UTC
Created attachment 115984 [details]
fix free() of constant string
Has this ever produced a bug? Passing pointer to memory not allocated by {m,c,re,v}alloc, memalign or posix_memalign to free is always a bug, could result in clobbering program's memory or various kinds of crashes. BTW, the above patch is IMHO not enough, there are places in gcj which expect JCF_FINISH to free the pointer which was passed to open_class (e.g. parse_zip_file_entries), and there are places like jcf-dump.c that pass not allocated memory to it. So I guess an audit is needed and after applying Colin's patch some places need to be fixed up to free the memory they allocated. Even normal glibc free does several consistency check, so it wouldn't surprise me if you could get jc1 or one of the utilities to crash unless this is fixed. I only found this bug last week :(. I wish I were somehow automatically CCd on gcj-related PRs. What a mess this code is. Ok, I tracked through this code and I don't see any big problems. Am I missing something? I looked at parse_zip_file_entries and all seems well there, to me. I think this patch is fine and I am going to check it in. Even if it is buggy it turns a potential crash into a small memory leak, which is an improvement. FWIW I checked this patch in back in April. Based on the date this bug was created, it appears to have been reported against rawhide during the development of a Fedora release that is no longer maintained. In order to refocus our efforts as a project we are flagging all of the open bugs for releases which are no longer maintained. If this bug remains in NEEDINFO thirty (30) days from now, we will automatically close it. If you can reproduce this bug in a maintained Fedora version (7, 8, or rawhide), please change this bug to the respective version and change the status to ASSIGNED. (If you're unable to change the bug's version or status, add a comment to the bug and someone will change it for you.) Thanks for your help, and we apologize again that we haven't handled these issues to this point. The process we're following is outlined here: http://fedoraproject.org/wiki/BugZappers/F9CleanUp We will be following the process here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this doesn't happen again. This bug has been in NEEDINFO for more than 30 days since feedback was first requested. As a result we are closing it. If you can reproduce this bug in the future against a maintained Fedora version please feel free to reopen it against that version. The process we're following is outlined here: http://fedoraproject.org/wiki/BugZappers/F9CleanUp |