pcp
[Top] [All Lists]

pcp updates - pmlogextract and pmlogrewrite changes from Coverity scans

To: pcp@xxxxxxxxxxx
Subject: pcp updates - pmlogextract and pmlogrewrite changes from Coverity scans
From: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Tue, 14 Feb 2012 06:10:54 +1100
Nothing particularly of note here, just some housekeeping.

Summaries are in
http://www.users.on.net/~kenj/pcp/coverity-pmlogextract.html and
http://www.users.on.net/~kenj/pcp/coverity-pmlogrewrite.html 

Changes committed to git://oss.sgi.com/kenj/pcp.git dev

 src/pmlogextract/logio.c        |   12 ++++++++++--
 src/pmlogextract/metriclist.c   |    4 ++--
 src/pmlogextract/pmlogextract.c |   33 +++++++++++++++++++--------------
 src/pmlogrewrite/indom.c        |   14 +++++++++++---
 src/pmlogrewrite/lex.l          |    1 +
 src/pmlogrewrite/logio.c        |    4 ++++
 src/pmlogrewrite/metric.c       |   16 +++++++++++-----
 src/pmlogrewrite/pmlogrewrite.c |   30 +++++++++++++++++++++++++++---
 src/pmlogrewrite/result.c       |   10 ++++++++++
 src/pmlogrewrite/util.c         |   12 ++++++++++--
 10 files changed, 105 insertions(+), 31 deletions(-)

commit 229ef5ba11abd31b2ac1f49113763c916034dd4a
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Mon Feb 13 20:54:29 2012 +1100

    pmlogrewrite/util.c - resource_leak
    Original Coverity cases #209, #215 and #228
    http://people.redhat.com/mgoodwin/pcp-cov/1/209util.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/215util.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/228util.c.html#error
    
    Add missing free() calls for locally malloc'd storage, and closedir()
    at end of loop.

commit f4916b4a07ea02b4d7f977d8046a3dd9fe07c2ef
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Mon Feb 13 20:46:12 2012 +1100

    pmlogrewrite/pmlogrewrite.c - resource_leak
    Original Coverity case #188
    http://people.redhat.com/mgoodwin/pcp-cov/1/188pmlogrewrite.c.html#error
    
    Add closedir() after opendir().

commit 33879bfe3aaa51ef46c453148a636f11aacd6f7a
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Mon Feb 13 06:39:36 2012 +1100

    pmlogrewrite/logio.c - resource_leak
    Original Coverity cases #185 and #201
    http://people.redhat.com/mgoodwin/pcp-cov/1/185logio.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/201logio.c.html#error
    
    Rework the freeing of memory on the error branches.

commit 8b7efb018317677ce8f753ef2f5c5581563e0e63
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Mon Feb 13 06:32:30 2012 +1100

    pmlogrewrite/logio.c - negative_returns
    Original Coverity case #112.
    http://people.redhat.com/mgoodwin/pcp-cov/1/112logio.c.html#error
    
    In the place where we use the results from ftell() in a subsequent call
    to fseek(), add an assert() to ensure the ftell() result is >= 0 ... the
    error case should not happen and is only expected by Coverity!

commit efee6ca98ecc825ed41976fbbd37b91286add357
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Mon Feb 13 06:20:35 2012 +1100

    pmlogrewrite/util.c - assorted Coverity fixes
    Original Coverity cases #45, #49 and #53.
    http://people.redhat.com/mgoodwin/pcp-cov/1/45util.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/49util.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/53util.c.html#error
    
    For some reason, Coverity fails to understand that control does
    not return from abandon(), but only in the util.c source file.
    
    Added /*NOTREACHED*/ annotation after each abandon() call to
    reinforce the fact that control will not reach here.

commit 86eff7837ad1b7b718158e3e77df1c949fa53619
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Sun Feb 12 07:40:24 2012 +1100

    pmlogrewrite/pmlogrewrite.c - negative_returns
    Original Coverity cases #87, #88 and #89.
    http://people.redhat.com/mgoodwin/pcp-cov/1/87pmlogrewrite.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/88pmlogrewrite.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/89pmlogrewrite.c.html#error
    
    In all the places where we use the results from ftell() in a
    subsequent call to fseek(), add an assert() to ensure the ftell()
    result is >= 0 ... the error cases should not happen and are only
    expected by Coverity!

commit 8bb13046200eaa46a5cdc6a12b016bf9c69c5e51
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Sun Feb 12 07:32:09 2012 +1100

    pmlogrewrite/indom.c - sizeof_mismatch
    Original Coverity cases #285 and #286.
    http://people.redhat.com/mgoodwin/pcp-cov/1/285indom.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/286indom.c.html#error
    
    Minor rewrite, no real change.

commit 8fda1611f639ae8fe081e36bfae1953db497e641
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Sun Feb 12 07:14:17 2012 +1100

    pmlogrewrite/metric.c - assorted Coverity fixes
    Original Coverity cases #55, #252, #283, #284 and #306.
    http://people.redhat.com/mgoodwin/pcp-cov/1/55metric.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/252metric.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/283metric.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/284metric.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/306metric.c.html#error
    
    Fixing a number of minor issues where Coverity analysis is correct,
    but for various reasons the bugs are benign.

commit a7d00a55aff54a1b786a7e4a0453dc8b758aeffb
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Sat Feb 11 17:12:01 2012 +1100

    pmlogextract/pmlogextract.c - unused_value
    Original Coverity case #308.
    http://people.redhat.com/mgoodwin/pcp-cov/1/308pmlogextract.c.html#error
    
    Remove variable and pointless assignment.

commit ed4f552420655ac6f6e17c8a44d4a9c62e022138
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Sat Feb 11 17:05:34 2012 +1100

    pmlogextract/pmlogextract.c - reverse_inull
    Original Coverity cases #262 and #265.
    http://people.redhat.com/mgoodwin/pcp-cov/1/262pmlogextract.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/265pmlogextract.c.html#error
    
    Clean up the handling of iap->_result.

commit 21467c780e1924fb3bda01affdaa381360e94576
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Sat Feb 11 07:18:57 2012 +1100

    pmlogextract/metriclist.c - reverse_inull
    Original Coverity case #253.
    http://people.redhat.com/mgoodwin/pcp-cov/1/253metriclist.c.html#error
    
    Check for NULL _before_ deref, duh.

commit 02301f86ee4db2555676e1ab4ec6bdaa9d82fb52
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Sat Feb 11 07:12:46 2012 +1100

    pmlogextract/logio.c - resource_leak
    Original Coverity cases #187 and #199.
    http://people.redhat.com/mgoodwin/pcp-cov/1/187logio.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/199logio.c.html#error
    
    free() malloc'd buffer on error paths.

commit 76f80b37cf06a75369bf2146b2c5bf04f30388c8
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Sat Feb 11 07:05:50 2012 +1100

    pmlogextract/logio.c - negative_returns
    Original Coverity case #110.
    http://people.redhat.com/mgoodwin/pcp-cov/1/110logio.c.html#error
    
    In the place where we use the results from ftell() in a subsequent call
    to fseek(), add an assert() to ensure the ftell() result is >= 0 ... the
    error case should not happen and is only expected by Coverity!

commit 8ae0a407de12e8cbbba3d0128dd52c0c22edb824
Author: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date:   Sat Feb 11 06:58:10 2012 +1100

    pmlogextract/pmlogextract.c - negative_returns
    Original Coverity cases #92, #93, #94 and #108.
    http://people.redhat.com/mgoodwin/pcp-cov/1/92pmlogextract.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/93pmlogextract.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/94pmlogextract.c.html#error
    http://people.redhat.com/mgoodwin/pcp-cov/1/108pmlogextract.c.html#error
    
    In all the places where we use the results from ftell() in a
    subsequent call to fseek(), add an assert() to ensure the ftell()
    result is >= 0 ... the error cases should not happen and are only
    expected by Coverity!



<Prev in Thread] Current Thread [Next in Thread>
  • pcp updates - pmlogextract and pmlogrewrite changes from Coverity scans, Ken McDonell <=