Author: mav Date: Mon Apr 6 18:42:01 2020 New Revision: 359662 URL: https://svnweb.freebsd.org/changeset/base/359662
Log: Relax too strict SES element descriptors check in r355430. SES specifications allows the string to be NULL-terminated, while previous code was considering it as invalid due to incorrectly ordered conditions. MFC after: 1 week Sponsored by: iXsystem, Inc. Modified: head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Mon Apr 6 17:28:17 2020 (r359661) +++ head/sys/cam/scsi/scsi_enc_ses.c Mon Apr 6 18:42:01 2020 (r359662) @@ -2004,11 +2004,11 @@ ses_sanitize_elm_desc(const char *desc, uint16_t *len) int i; for (i = 0; i < *len; i++) { - if (desc[i] < 0x20 || desc[i] > 0x7e) { + if (desc[i] == 0) { + break; + } else if (desc[i] < 0x20 || desc[i] > 0x7e) { *len = strlen(invalid); return (invalid); - } else if (desc[i] == 0) { - break; } } return (desc); _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"