Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 228725 - [RHEL4] [patch] cid-21 Fix memory leak in libss (ss_execute_line)
Summary: [RHEL4] [patch] cid-21 Fix memory leak in libss (ss_execute_line)
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: e2fsprogs
Version: 4.4
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Eric Sandeen
QA Contact: Jay Turner
Depends On:
Blocks: 239341
TreeView+ depends on / blocked
Reported: 2007-02-14 17:14 UTC by Bryn M. Reeves
Modified: 2018-10-19 22:58 UTC (History)
2 users (show)

Fixed In Version: RHBA-2007-0758
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-11-15 16:01:46 UTC
Target Upstream Version:

Attachments (Terms of Use)
Correct freeing of argv in ss_execute_line (deleted)
2007-02-14 17:14 UTC, Bryn M. Reeves
no flags Details | Diff

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0758 normal SHIPPED_LIVE e2fsprogs bug fix update 2007-11-14 17:06:52 UTC

Description Bryn M. Reeves 2007-02-14 17:14:42 UTC
Description of problem:
The function ss_execute_line in execute_cmd.c contains the following code:

    /* parse it */
    argv = ss_parse(sci_idx, line_ptr, &argc);
    if (argc == 0)
        return 0;

Potentially we need to free argv before early return since it was allocated
memory. We need to be careful and check argv since it may be possible for
ss_parse() to have freed the memory allocated to it if it detects an unbalanced
set of quotes passed to it.

Version-Release number of selected component (if applicable):

How reproducible:
Not sure.

Steps to Reproduce:
Also tricky to reproduce this one. I'm not familiar with ss's internals to come
up with a test case that will clearly show this problem, but again the flaw is
fairly obvious.
Actual results:
ss_execute_line may fail to free resources allocated by it.

Expected results:
ss_execute_line correctly frees resources allocated by it.

Comment 1 Bryn M. Reeves 2007-02-14 17:14:43 UTC
Created attachment 148070 [details]
Correct freeing of argv in ss_execute_line

Comment 4 RHEL Product and Program Management 2007-05-09 07:39:06 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update

Comment 5 Eric Sandeen 2007-05-29 20:35:52 UTC
upstream commit

Comment 6 Benjamin Kahn 2007-06-08 14:38:07 UTC
Applying a DEV_ACK for Eric Sandeen <>.  This bug
    was found by coverity and has a patch available.

Comment 8 Eric Sandeen 2007-07-02 20:42:58 UTC
In cvs as of e2fsprogs-1.35-12.7.el4

Comment 12 errata-xmlrpc 2007-11-15 16:01:46 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.