⬢ DragonFlyBSD Kernel Audit
DF-2465 / fix.diff
← back to finding ↓ download raw
# DF-2465 fix (authored post-verification; not applied to sys/)
--- a/sys/dev/disk/iscsi/initiator/isc_subr.c
+++ b/sys/dev/disk/iscsi/initiator/isc_subr.c
@@ -84,7 +84,7 @@ int
 i_setopt(isc_session_t *sp, isc_opt_t *opt)
 {
-     const int	digsize = 6;
+     const int	digsize = 7;	/* 6 chars + NUL */
@@ -127,7 +127,8 @@ i_setopt(isc_session_t *sp, isc_opt_t *opt)
      /* Try to copy the userland pointer containing the header digest */
      if(opt->headerDigest != NULL) {
-	  if ((copyinstr(opt->headerDigest, &hdigest, digsize, &len)) != EFAULT) {
+	  if (copyinstr(opt->headerDigest, &hdigest, digsize, &len) == 0) {