Bug 723518 - static code analysis using cppcheck found some issues
Summary: static code analysis using cppcheck found some issues
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: ksh
Version: rawhide
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Michal Hlavinka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-20 12:27 UTC by Miroslav Franc
Modified: 2016-02-01 02:27 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-14 08:52:06 UTC
Type: ---


Attachments (Terms of Use)

Description Miroslav Franc 2011-07-20 12:27:06 UTC
Description of problem:

SSIA. The most obvious ones are missing brackets (lib/libcmd/tty.c:94, lib/libast/port/astconf.c:697) or out of bound array access (cmd/ksh93/sh/xec.c:3508). The memory leak warnings might be bogus considering nature of ksh, but I believe they deserve to be looked at.



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

ksh-20110505-2.fc15



Additional info:

[cmd/INIT/proto.c:1803]: (error) syntax error
[cmd/INIT/ratz.c:3739]: (error) Memory leak: s.path
[cmd/ksh93/sh/name.c:137]: (error) Common realloc mistake: 'buf' nulled but not freed upon failure
[cmd/ksh93/sh/nvtype.c:631]: (error) Possible null pointer dereference: np - otherwise it is redundant to check if np is null at line 629
[cmd/ksh93/sh/nvtype.c:1362]: (error) Memory leak: val
[cmd/ksh93/sh/path.c:936]: (error) Resource leak: fd
[cmd/ksh93/sh/suid_exec.c:397]: (error) Resource leak: n
[cmd/ksh93/sh/xec.c:666]: (error) Memory leak: sp
[cmd/ksh93/sh/xec.c:3508]: (error) Array 'arglist[2]' index 2 out of bounds
[lib/libast/comp/omitted.c:240]: (error) Array 'buf[2]' index 60 out of bounds
[lib/libast/comp/omitted.c:240]: (error) Array 'buf[2]' index 61 out of bounds
[lib/libast/comp/wordexp.c:115]: (error) Unusual pointer arithmetic
[lib/libast/disc/sfdcmore.c:368]: (error) Memory leak: more
[lib/libast/disc/sfdcprefix.c:152]: (error) Memory leak: pfx
[lib/libast/port/astconf.c:697]: (error) Invalid number of character (() when these macros are defined: 'ATT_UNIV;UNIV_MAX'.
[lib/libast/port/lcgen.c:537]: (error) Memory leak: ap
[lib/libast/port/lcgen.c:308]: (error) Resource leak: hf
[lib/libast/sfio/_sfopen.c:100]: (error) Resource leak: fd
[lib/libast/sfio/_sfopen.c:109]: (error) Resource leak: tf
[lib/libast/stdio/vfwprintf.c:64]: (error) Memory leak: m
[lib/libcmd/tty.c:94]: (error) Invalid number of character (() when these macros are defined: '_mac_STWLINE'.

Comment 1 Michal Hlavinka 2011-12-14 08:52:06 UTC
checked for false positives and reported upstream


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