author | Sebastian Harl <sh@tokkee.org> | |
Sat, 2 Aug 2014 15:10:49 +0000 (17:10 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 2 Aug 2014 15:10:49 +0000 (17:10 +0200) | ||
commit | 3aa4afeb00d82797c271d37acd7979b1b9b0f0a5 | |
tree | f3aca9772bf0cbe51dd3ab95955f6264fe9dad03 | tree | snapshot |
parent | 6fbca0cdf68f596a6711fa6b09aa39e35aade71f | commit | diff |
frontend: Make sure to not read to much from a connection buffer.
The current command, as stored in the connection buffer, is not necessarily
nil-terminated. That's only the case if there's no further data in the buffer
(which will *often* be the case in the current implementation when using
'sysdb' as the client) but the code should never rely on that.
In cases where the function operating on the data does not support specifying
the length of the string to work on, copy the data to a temporary buffer
first.
The current command, as stored in the connection buffer, is not necessarily
nil-terminated. That's only the case if there's no further data in the buffer
(which will *often* be the case in the current implementation when using
'sysdb' as the client) but the code should never rely on that.
In cases where the function operating on the data does not support specifying
the length of the string to work on, copy the data to a temporary buffer
first.
src/frontend/connection.c | diff | blob | history |