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.
This commit is contained in:
mav 2020-04-06 18:42:01 +00:00
parent c97548ee45
commit d60235a3df

View File

@ -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);