mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 09:27:59 +00:00
Remove obsolete sanitise_term_data().
The previous commit removed its last use, so now we can garbage- collect it, including its long-standing FIXME comment which is now fulfilled by the new StripCtrlChars system.
This commit is contained in:
parent
7b48922761
commit
d2ddb2fdf4
2
misc.h
2
misc.h
@ -137,8 +137,6 @@ static inline void bufchain_set_callback(bufchain *ch, IdempotentCallback *ic)
|
||||
bufchain_set_callback_inner(ch, ic, queue_idempotent_callback);
|
||||
}
|
||||
|
||||
void sanitise_term_data(bufchain *out, const void *vdata, size_t len);
|
||||
|
||||
bool validate_manual_hostkey(char *key);
|
||||
|
||||
struct tm ltime(void);
|
||||
|
26
utils.c
26
utils.c
@ -756,32 +756,6 @@ size_t bufchain_fetch_consume_up_to(bufchain *ch, void *data, size_t len)
|
||||
return len;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
* Sanitise terminal output that we have reason not to trust, e.g.
|
||||
* because it appears in the login banner or password prompt from a
|
||||
* server, which we'd rather not permit to use arbitrary escape
|
||||
* sequences.
|
||||
*/
|
||||
|
||||
void sanitise_term_data(bufchain *out, const void *vdata, size_t len)
|
||||
{
|
||||
const char *data = (const char *)vdata;
|
||||
|
||||
/*
|
||||
* FIXME: this method of sanitisation is ASCII-centric. It would
|
||||
* be nice to permit SSH banners and the like to contain printable
|
||||
* Unicode, but that would need a lot more complicated code here
|
||||
* (not to mention knowing what character set it should interpret
|
||||
* the data as).
|
||||
*/
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
if (data[i] == '\n')
|
||||
bufchain_add(out, "\r\n", 2);
|
||||
else if (data[i] >= ' ' && data[i] < 0x7F)
|
||||
bufchain_add(out, data + i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
* Debugging routines.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user