The variable name is passed as (ptr,len) suggesting that certain callers
might not always have 0-terminated strings (e.g. when used in arguments
where closing parenthesis or commas might follow), the error message
carefully tries to designate the first invalid character, yet by mistake
it prints the whole string. This mistake has been there since commit
4834bc773c ("MEDIUM: vars: adds support of variables") in 1.6. Let's
properly report the char as promised instead. This could be backported
but is totally unimportant.
/* Check variable name syntax. */
for (tmp = name; tmp < name + len; tmp++) {
if (!isalnum((unsigned char)*tmp) && *tmp != '_' && *tmp != '.') {
- memprintf(err, "invalid syntax at char '%s'", tmp);
+ memprintf(err, "invalid syntax at char '%c'", *tmp);
return 0;
}
}