aboutsummaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-05 09:08:30 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-05 09:08:30 +0000
commit9abc5ca971b12c53f4d424d2bb3345f5a2b2007f (patch)
treed7506a2a8691d79fa3702b7f8b3d25e77f2b7237 /log.c
parentserver: workaround evil clients (diff)
server/client: harden reading of initialization data, and make async
* Client terminal initialization data is now received asynchronously. To facilitate this, a couple of minor changes to the protocol was made: - The client now starts with sending a 4-byte unsigned integer with the *total* size of the initialization data (*not* including the size field itself. - Strings (TERM variable + argv) are now sent NULL-terminated * The server allocates a single buffer, and fills it asynchronously. When full (as indicated by the initial 'total size' integer), we parse it (taking care not to read outside boundaries etc, and verifies the lengths (of the TERM variable and argv array) indicated by the client matches the actual lengths of the strings received. * The server now ignores 'unexpected' data received from the client, after the terminal has been instantiated.
Diffstat (limited to 'log.c')
0 files changed, 0 insertions, 0 deletions