diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-01-02 23:51:57 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2009-01-02 23:51:57 +0000 |
commit | d9397119c5d31daeb10a83afb6cc02f3b40878b1 (patch) | |
tree | 8f0f2d318c4a9b7c8a854e8bde67349f4a591b08 /package/ead/src/ead-client.c | |
parent | c7ff578b9fd7e11ca05a5d5c9db2ea4dbb0f1e7b (diff) | |
download | upstream-d9397119c5d31daeb10a83afb6cc02f3b40878b1.tar.gz upstream-d9397119c5d31daeb10a83afb6cc02f3b40878b1.tar.bz2 upstream-d9397119c5d31daeb10a83afb6cc02f3b40878b1.zip |
ead: message handling fixes
SVN-Revision: 13828
Diffstat (limited to 'package/ead/src/ead-client.c')
-rw-r--r-- | package/ead/src/ead-client.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/package/ead/src/ead-client.c b/package/ead/src/ead-client.c index 111dc8ac63..14e04c40ba 100644 --- a/package/ead/src/ead-client.c +++ b/package/ead/src/ead-client.c @@ -143,7 +143,10 @@ static bool handle_pong(void) { struct ead_msg_pong *pong = EAD_DATA(msg, pong); - int len = msg->len - sizeof(struct ead_msg_pong); + int len = ntohl(msg->len) - sizeof(struct ead_msg_pong); + + if (len <= 0) + return false; pong->name[len] = 0; auth_type = ntohs(pong->auth_type); |