Hi, some tables used with "genget()" use table entries with a single space character as entry name for special purposes, i.e., as empty lines or comment lines. Thus an entry with name " " is not intended as a valid table entry, but "genget()" does not treat those entries differently from valid antries. It should instead reject any attempt to get the entry to the name " ".
Rejecting to get the table entry for " " would have masked that both setcmd() and unsetcmd() are not able to handle those table entries. Thus this rejecting the name " " can be seen to improve robustness. The attached patch "inetutils-libtelnet-genget-no_space_command.patch" implements this. [The genget() function requires "name" to be a valid C string already.] Thanks, Erik -- The computing scientist’s main challenge is not to get confused by the complexities of his own making. -- Edsger W. Dijkstra
diff --git a/libtelnet/genget.c b/libtelnet/genget.c index 6051f7b4..eae4ecd0 100644 --- a/libtelnet/genget.c +++ b/libtelnet/genget.c @@ -87,7 +87,7 @@ genget (char *name, char **table, int stlen) register char **c, **found; register int n; - if (name == 0) + if (name == 0 || (name[0] == ' ' && name[1] == '\0')) return 0; found = 0;