Project

General

Profile

Actions

Bug #5970

open

Many source files don't handle realloc() failure

Added by Gary Mills almost 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2015-05-29
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

The realloc() function normally returns a pointer to the new memory area. If it fails because memory is not available, it returns NULL . Most code in illumos that calls realloc() does handle failure correctly, but some files don't, risking a core dump instead. Files in the following list have at least one instance where they don't handle realloc() failure:

usr/src/cmd/allocate/allocate3.c
usr/src/cmd/avs/dsw/iiadm.c
usr/src/cmd/avs/sdbc/sd_stats.c
usr/src/cmd/checknr/checknr.c
usr/src/cmd/cmd-inet/lib/nwamd/enm.c
usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_scf.c
usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_import.c
usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c
usr/src/cmd/cmd-inet/usr.sbin/routeadm/routeadm.c
usr/src/cmd/dis/dis_target.c
usr/src/cmd/eeprom/i386/benv.c
usr/src/cmd/filesync/anal.c
usr/src/cmd/filesync/files.c
usr/src/cmd/fs.d/nfs/nfsref/nfsref.c
usr/src/cmd/hal/tools/hal-device.c
usr/src/cmd/idmap/idmap/idmap_engine.c
usr/src/cmd/ipcs/ipcs.c
usr/src/cmd/ipf/lib/common/ipft_pc.c
usr/src/cmd/ipf/lib/common/ipft_sn.c
usr/src/cmd/localedef/ctype.c
usr/src/cmd/lp/filter/postscript/dpost/dpost.c
usr/src/cmd/lp/lib/papi/lpsched-jobs.c
usr/src/cmd/lp/model/lp.tell.c
usr/src/cmd/lvm/metassist/common/volume_dlist.c
usr/src/cmd/pcitool/pcitool.c
usr/src/cmd/rexd/rpc.rexd.c
usr/src/cmd/svr4pkg/libinst/depchk.c
usr/src/cmd/svr4pkg/libinst/sml.c
usr/src/cmd/svr4pkg/pkgcond/main.c
usr/src/cmd/ypcmd/yppush.c
usr/src/lib/krb5/ss/invocation
usr/src/lib/libadm/common/ckgid.c
usr/src/lib/libadm/common/ckitem.c
usr/src/lib/libast/common/sfio/sfresize.c
usr/src/lib/libbe/common/be_list.c
usr/src/lib/libcurses/screen/delkey.c
usr/src/lib/libfru/libfru/Ancestor.cc
usr/src/lib/libfru/libfruraw/fruraw.c
usr/src/lib/libfru/libfrureg/frureg.c
usr/src/lib/libinstzones/common/zones_exec.c
usr/src/lib/libkmf/ber_der/common/decode.c
usr/src/lib/libpkg/common/pkgerr.c
usr/src/lib/libshell/common/bltins/typeset.c
usr/src/lib/libzfs/common/libzfs_pool.c
usr/src/tools/pmodes/binsearch.c

Related issues

Has duplicate illumos gate - Bug #5679: be_sort_list(): Possible null pointer dereferenceClosedGary Mills2015-03-02

Actions
Actions #1

Updated by Marcel Telka almost 7 years ago

  • Has duplicate Bug #5679: be_sort_list(): Possible null pointer dereference added
Actions

Also available in: Atom PDF