smyrna: incorrect tokenization in frmobjectui.c:set_attr_object_type
cmd/smyrna/frmobjectui.c:set_attr_object_type reads as follows:
static void set_attr_object_type(char *str, int *t)
{
char *a;
a = strtok(str, " ");
object_type_helper(a, t);
while ((a = strtok(NULL, " or ")))
object_type_helper(a, t);
}
Note the second call to strtok
. This is not how strtok
is intended to be used. Quoting the man page about the second argument:
These tokens are separated in the string by at least one of the characters in sep.
The second argument defines a list of separating characters. So the second call here splits on any of the characters ' '
, 'o'
, or 'r'
. The author clearly intended to split on the literal string " or "
instead.