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-user



Hi,

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

5 new defect(s) introduced to NetBSD-i386-user found with Coverity Scan.
4 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 5 of 5 defect(s)


** CID 275186:  Integer handling issues  (NEGATIVE_RETURNS)


________________________________________________________________________________________________________
*** CID 275186:  Integer handling issues  (NEGATIVE_RETURNS)
/crypto/external/bsd/heimdal/dist/kdc/kx509.c: 109 in calculate_reply_hash()
103         HMAC_CTX ctx;
104     
105         HMAC_CTX_init(&ctx);
106     
107         HMAC_Init_ex(&ctx, key->keyvalue.data, key->keyvalue.length,
108     		 EVP_sha1(), NULL);
>>>     CID 275186:  Integer handling issues  (NEGATIVE_RETURNS)
>>>     "EVP_MD_size(ctx.md)" is passed to a parameter that cannot be negative.
109         ret = krb5_data_alloc(rep->hash, HMAC_size(&ctx));
110         if (ret) {
111     	HMAC_CTX_cleanup(&ctx);
112     	krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
113     	return ENOMEM;
114         }

** CID 1307744:  Incorrect expression  (IDENTICAL_BRANCHES)
/sys/rump/librump/rumpkern/rump_syscalls.c: 3093 in rump___sysimpl___posix_chown()


________________________________________________________________________________________________________
*** CID 1307744:  Incorrect expression  (IDENTICAL_BRANCHES)
/sys/rump/librump/rumpkern/rump_syscalls.c: 3093 in rump___sysimpl___posix_chown()
3087     	SPARG(&callarg, uid) = uid;
3088     	SPARG(&callarg, gid) = gid;
3089     
3090     	error = rsys_syscall(SYS___posix_chown, &callarg, sizeof(callarg), retval);
3091     	rsys_seterrno(error);
3092     	if (error == 0) {
>>>     CID 1307744:  Incorrect expression  (IDENTICAL_BRANCHES)
>>>     The same code is executed regardless of whether "0" is true, because the 'then' and 'else' branches are identical. Should one of the branches be modified, or the entire 'if' statement replaced?
3093     		if (sizeof(int) > sizeof(register_t))
3094     			rv = *(int *)retval;
3095     		else
3096     			rv = *retval;
3097     	}
3098     	return rv;

** CID 1307745:  Incorrect expression  (IDENTICAL_BRANCHES)
/sys/rump/librump/rumpkern/rump_syscalls.c: 3153 in rump___sysimpl___posix_lchown()


________________________________________________________________________________________________________
*** CID 1307745:  Incorrect expression  (IDENTICAL_BRANCHES)
/sys/rump/librump/rumpkern/rump_syscalls.c: 3153 in rump___sysimpl___posix_lchown()
3147     	SPARG(&callarg, uid) = uid;
3148     	SPARG(&callarg, gid) = gid;
3149     
3150     	error = rsys_syscall(SYS___posix_lchown, &callarg, sizeof(callarg), retval);
3151     	rsys_seterrno(error);
3152     	if (error == 0) {
>>>     CID 1307745:  Incorrect expression  (IDENTICAL_BRANCHES)
>>>     The same code is executed regardless of whether "0" is true, because the 'then' and 'else' branches are identical. Should one of the branches be modified, or the entire 'if' statement replaced?
3153     		if (sizeof(int) > sizeof(register_t))
3154     			rv = *(int *)retval;
3155     		else
3156     			rv = *retval;
3157     	}
3158     	return rv;

** CID 1307746:  Incorrect expression  (IDENTICAL_BRANCHES)
/sys/rump/librump/rumpkern/rump_syscalls.c: 3123 in rump___sysimpl___posix_fchown()


________________________________________________________________________________________________________
*** CID 1307746:  Incorrect expression  (IDENTICAL_BRANCHES)
/sys/rump/librump/rumpkern/rump_syscalls.c: 3123 in rump___sysimpl___posix_fchown()
3117     	SPARG(&callarg, uid) = uid;
3118     	SPARG(&callarg, gid) = gid;
3119     
3120     	error = rsys_syscall(SYS___posix_fchown, &callarg, sizeof(callarg), retval);
3121     	rsys_seterrno(error);
3122     	if (error == 0) {
>>>     CID 1307746:  Incorrect expression  (IDENTICAL_BRANCHES)
>>>     The same code is executed regardless of whether "0" is true, because the 'then' and 'else' branches are identical. Should one of the branches be modified, or the entire 'if' statement replaced?
3123     		if (sizeof(int) > sizeof(register_t))
3124     			rv = *(int *)retval;
3125     		else
3126     			rv = *retval;
3127     	}
3128     	return rv;

** CID 1307747:  Code maintainability issues  (UNUSED_VALUE)
/usr.bin/xinstall/xinstall.c: 1006 in run()


________________________________________________________________________________________________________
*** CID 1307747:  Code maintainability issues  (UNUSED_VALUE)
/usr.bin/xinstall/xinstall.c: 1006 in run()
1000     	if (*command == '/')
1001     		rv = posix_spawn(NULL, command, NULL, NULL, args, NULL);
1002     	else
1003     		rv = posix_spawnp(NULL, command, NULL, NULL, args, NULL);
1004     	if (rv != 0) {
1005     		warnc(rv, "Cannot execute %s", command);
>>>     CID 1307747:  Code maintainability issues  (UNUSED_VALUE)
>>>     Assigning value "-1" to "rv" here, but that stored value is overwritten before it can be used.
1006     		rv = -1;
1007     	}
1008     #else
1009     	switch (vfork()) {
1010     	case -1:
1011     		rv = errno;


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

To manage Coverity Scan email notifications for "coverity-updates%netbsd.org@localhost", click https://scan.coverity.com/subscriptions/edit?email=coverity-updates%40netbsd.org&token=487286ca1a9a4f4bd485d16f66b5e782 .



Home | Main Index | Thread Index | Old Index