mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +00:00
Better bounds checking in the exit-signal handler.
[originally from svn r4670]
This commit is contained in:
parent
5ff0e6b1d9
commit
64821979b1
5
ssh.c
5
ssh.c
@ -6418,9 +6418,10 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen, int ispkt)
|
||||
#define CHECK_HYPOTHESIS(offset, result) \
|
||||
do { \
|
||||
long q = offset; \
|
||||
if (q+4 <= len) { \
|
||||
if (q >= 0 && q+4 <= len) { \
|
||||
q = q + 4 + GET_32BIT(p+q); \
|
||||
if (q+4 <= len && (q = q + 4 + GET_32BIT(p+q)) && q == len) \
|
||||
if (q >= 0 && q+4 <= len && \
|
||||
(q = q + 4 + GET_32BIT(p+q)) && q == len) \
|
||||
result = TRUE; \
|
||||
} \
|
||||
} while(0)
|
||||
|
Loading…
Reference in New Issue
Block a user