/* strip trailing whitespace */
len = strnlen(from, count);
- while (isspace(from[len-1]))
+ while (len && isspace(from[len-1]))
len--;
/* strip leading whitespace */
print:
set_str(name, vid->label, sizeof(vid->label));
+ replace_untrusted_chars(name);
switch (print) {
case PRINT_EXPORT: