Coverity-updates archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

New Defects reported by Coverity Scan for NetBSD-i386-kernel



Hi,


Please find the latest report on new defect(s) introduced to NetBSD-i386-kernel 
found with Coverity Scan.

Defect(s) Reported-by: Coverity Scan
Showing 3 of 3 defect(s)


** CID 1216449:  Mixing enum types  (MIXED_ENUMS)
/sys/miscfs/genfs/layer_vfsops.c: 227 in layerfs_loadvnode()

** CID 1216450:  Mixing enum types  (MIXED_ENUMS)
/sys/miscfs/genfs/layer_vfsops.c: 227 in layerfs_loadvnode()

** CID 1216451:  Dereference before null check  (REVERSE_INULL)
/sys/netinet/ip_input.c: 589 in ip_input()
/sys/netinet/ip_input.c: 612 in ip_input()


________________________________________________________________________________________________________
*** CID 1216449:  Mixing enum types  (MIXED_ENUMS)
/sys/miscfs/genfs/layer_vfsops.c: 227 in layerfs_loadvnode()
221     
222             /* Share the interlock with the lower node. */
223             mutex_obj_hold(lowervp->v_interlock);
224             uvm_obj_setlock(&vp->v_uobj, lowervp->v_interlock);
225             vp->v_iflag |= VI_LAYER | VI_LOCKSHARE;
226     
>>>     CID 1216449:  Mixing enum types  (MIXED_ENUMS)
>>>     Mixing enum types enum vtype and enum vtagtype for "layerm_tag".
227             vp->v_tag = lmp->layerm_tag;
228             vp->v_type = lowervp->v_type;
229             vp->v_op = lmp->layerm_vnodeop_p;
230             if (vp->v_type == VBLK || vp->v_type == VCHR)
231                     spec_node_init(vp, lowervp->v_rdev);
232             vp->v_data = xp;

________________________________________________________________________________________________________
*** CID 1216450:  Mixing enum types  (MIXED_ENUMS)
/sys/miscfs/genfs/layer_vfsops.c: 227 in layerfs_loadvnode()
221     
222             /* Share the interlock with the lower node. */
223             mutex_obj_hold(lowervp->v_interlock);
224             uvm_obj_setlock(&vp->v_uobj, lowervp->v_interlock);
225             vp->v_iflag |= VI_LAYER | VI_LOCKSHARE;
226     
>>>     CID 1216450:  Mixing enum types  (MIXED_ENUMS)
>>>     Mixing enum types enum vtagtype and enum vtype for "v_tag".
227             vp->v_tag = lmp->layerm_tag;
228             vp->v_type = lowervp->v_type;
229             vp->v_op = lmp->layerm_vnodeop_p;
230             if (vp->v_type == VBLK || vp->v_type == VCHR)
231                     spec_node_init(vp, lowervp->v_rdev);
232             vp->v_data = xp;

________________________________________________________________________________________________________
*** CID 1216451:  Dereference before null check  (REVERSE_INULL)
/sys/netinet/ip_input.c: 589 in ip_input()
583              * to the loopback interface instead of the interface where
584              * the packets are received.
585              *
586              * XXX - We need to add a per ifaddr flag for this so that
587              * we get finer grain control.
588              */
>>>     CID 1216451:  Dereference before null check  (REVERSE_INULL)
>>>     Null-checking "ifp" suggests that it may be null, but it has already 
>>> been dereferenced on all paths leading to the check.
589             checkif = ip_checkinterface && (ipforwarding == 0) &&
590                 ifp && (ifp->if_flags & IFF_LOOPBACK) == 0;
591     
592             /*
593              * Check our list of addresses, to see if the packet is for us.
594              *
/sys/netinet/ip_input.c: 612 in ip_input()
606                             else
607                                     downmatch++;
608                     }
609             }
610             if (ia != NULL)
611                     goto ours;
>>>     CID 1216451:  Dereference before null check  (REVERSE_INULL)
>>>     Null-checking "ifp" suggests that it may be null, but it has already 
>>> been dereferenced on all paths leading to the check.
612             if (ifp && ifp->if_flags & IFF_BROADCAST) {
613                     IFADDR_FOREACH(ifa, ifp) {
614                             if (ifa->ifa_addr->sa_family != AF_INET)
615                                     continue;
616                             ia = ifatoia(ifa);
617                             if (in_hosteq(ip->ip_dst, 
ia->ia_broadaddr.sin_addr) ||


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, 
http://scan.coverity.com/projects/1450?tab=overview

To unsubscribe from the email notification for new defects, 
http://scan5.coverity.com/cgi-bin/unsubscribe.py




Home | Main Index | Thread Index | Old Index