Bug 723518

Summary: static code analysis using cppcheck found some issues
Product: [Fedora] Fedora Reporter: Miroslav Franc <mfranc>
Component: kshAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: rawhideCC: mhlavink, ohudlick
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-14 08:52:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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