(Coverity).
* hlfsd/homedir.c (delay): remove unnecessary check for NULL
pointer (Coverity).
* fsinfo/fsi_analyze.c (analyze_dkmounts, analyze_mounts,
analyze_mounts): avoid potential dereferencing of a NULL pointer
(Coverity).
* conf/transp/transp_sockets.c (create_amq_service): avoid
potential dereferencing of a NULL pointer (Coverity).
* amd/sched.c (sigchld): properly check for the end of the waiting
process list (Coverity).
* amd/mapc.c (mapc_create): initialize 'modify' to zero (Coverity).
* amd/autil.c (amfs_mkcacheref, am_unmounted): avoid potential
dereferencing of a NULL pointer (Coverity).
* amd/amfs_generic.c (amfs_lookup_mntfs): free def_opts before
reusing it (memory leak bug detected by Coverity).
(amfs_bgmount): avoid potential dereferencing of a NULL pointer
(Coverity).
* amd/am_ops.c (merge_opts): no need to check if newstr is NULL
(bug detected by Coverity).
+2006-03-20 Christos Zoulas <christos@zoulas.com>
+
+ * libamu/wire.c: avoid potential dereferencing of a NULL pointer
+ (Coverity).
+
+ * hlfsd/homedir.c (delay): remove unnecessary check for NULL
+ pointer (Coverity).
+
+ * fsinfo/fsi_analyze.c (analyze_dkmounts, analyze_mounts,
+ analyze_mounts): avoid potential dereferencing of a NULL pointer
+ (Coverity).
+
+ * conf/transp/transp_sockets.c (create_amq_service): avoid
+ potential dereferencing of a NULL pointer (Coverity).
+
+ * amd/sched.c (sigchld): properly check for the end of the waiting
+ process list (Coverity).
+
+ * amd/mapc.c (mapc_create): initialize 'modify' to zero (Coverity).
+
+ * amd/autil.c (amfs_mkcacheref, am_unmounted): avoid potential
+ dereferencing of a NULL pointer (Coverity).
+
+ * amd/amfs_generic.c (amfs_lookup_mntfs): free def_opts before
+ reusing it (memory leak bug detected by Coverity).
+ (amfs_bgmount): avoid potential dereferencing of a NULL pointer
+ (Coverity).
+
+ * amd/am_ops.c (merge_opts): no need to check if newstr is NULL
+ (bug detected by Coverity).
+
2006-03-08 Ion Badulescu <ionut@moisil.badula.org>
* amd/nfs_subr.c (mp_to_fh): fixed old-style filehandles--the pid
i386-unknown-openbsd3.8
- Bugs fixed:
+ * one serious memory leak in amfs_generic (caught by Coverity)
+ * assorted potential (but rare) NULL pointer dereferences (Coverity)
* correctly print nfs_args->addr info (sin_family/port/addr)
* pawd should resolve path repeatedly until no more to do
* handle old-style filehandles correctly (for mount points longer
if (amu_hasmntopt(&mnt2, oneopt) || amu_hasmntopt(&mnt2, revoneopt))
continue;
/* add option to returned string */
- if (newstr && newstr[0]) {
+ if (newstr[0]) {
xstrlcat(newstr, ",", len);
xstrlcat(newstr, tmpstr, len);
} else {
/*
* Pick up new defaults
*/
+ XFREE(def_opts);
def_opts = str3cat((char *) NULL, def_opts, ";", *cur_ivec + 1);
dlog("Setting def_opts to \"%s\"", def_opts);
continue;
goto already_mounted;
}
- if (mf->mf_fo->fs_mtab) {
+ if (mf->mf_fo && mf->mf_fo->fs_mtab) {
plog(XLOG_MAP, "Trying mount of %s on %s fstype %s mount_type %s",
mf->mf_fo->fs_mtab, mf->mf_mount, p->fs_type,
mp->am_flags & AMF_AUTOFS ? "autofs" : "non-autofs");
if (this_error < 0)
goto retry;
- if (mf->mf_fo->opt_delay) {
+ if (mf->mf_fo && mf->mf_fo->opt_delay) {
/*
* If there is a delay timer on the mount
* then don't try to mount if the timer
cache = "none";
mf->mf_private = (opaque_t) mapc_find(mf->mf_info,
cache,
- mf->mf_fo->opt_maptype,
+ (mf->mf_fo ? mf->mf_fo->opt_maptype : NULL),
mf->mf_mount);
mf->mf_prfree = mapc_free;
}
if (mp->am_parent && mp->am_parent->am_mnt)
clocktime(&mp->am_parent->am_fattr.na_mtime);
- if (mp->am_flags & AMF_REMOUNT) {
+ if (mp->am_parent && (mp->am_flags & AMF_REMOUNT)) {
char *fname = strdup(mp->am_name);
am_node *mp_parent = mp->am_parent;
mntfs *mf_parent = mp_parent->am_mnt;
{
mnt_map *m = ALLOC(struct mnt_map);
map_type *mt;
- time_t modify;
+ time_t modify = 0;
u_int alloc = 0;
cmdoption(opt, mapc_opt, &alloc);
}
} /* end of for loop */
- if (!p)
+ if (p == HEAD(pjob, &proc_wait_list))
dlog("can't locate task block for pid %d", pid);
/*
# ifndef RPC_MAXDATASIZE
# define RPC_MAXDATASIZE 9000
# endif /* not RPC_MAXDATASIZE */
- {
+ if (tcp_amqpp) {
int maxrec = RPC_MAXDATASIZE;
SVC_CONTROL(*tcp_amqpp, SVCSET_CONNMAXREC, &maxrec);
}
/*
* Now see if a default mount point is required
*/
- if (STREQ(mp2->m_name, "default")) {
+ if (mp2 && STREQ(mp2->m_name, "default")) {
if (ISSET(mp2->m_mask, DM_VOLNAME)) {
char nbuf[1024];
compute_automount_point(nbuf, sizeof(nbuf), dk->d_host, mp2->m_volname);
ITER(dd, dict_data, &de->de_q) {
fsi_mount *mp = (fsi_mount *) dd->dd_data;
- if (STREQ(mp->m_dk->d_host->h_hostname, fp->f_from)) {
+ if (fp->f_from &&
+ STREQ(mp->m_dk->d_host->h_hostname, fp->f_from)) {
mp2 = mp;
break;
}
lerror(fp->f_ioloc, "volname %s unknown", fp->f_volname);
} else if (matched) {
- fixup_required_mount_info(fp, de);
+ if (de)
+ fixup_required_mount_info(fp, de);
req = ~fp->f_mask & FM_REQUIRED;
if (req) {
show_required(fp->f_ioloc, req, fp->f_volname, hp->h_hostname,
{
struct timeval tv;
- if (found)
- dlog("delaying on child %ld for %d seconds", (long) found->child, secs);
+ dlog("delaying on child %ld for %d seconds", (long) found->child, secs);
tv.tv_usec = 0;
al = getwire_lookup(S2IN(ifap->ifa_dstaddr), 0xffffffff, 1);
/* append to the end of the list */
- if (!localnets) {
+ if (!localnets || tail == NULL) {
localnets = tail = al;
tail->ip_next = NULL;
} else {