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 | a59a9bf3a9ae86ea8b6a0c2af93de2d3d526fdbc (patch) | |
tree | db39ea28c22360cc737b14f17fa5c139e83d98f3 /package/ead/src/ead-client.c | |
parent | 3863a62c91cf747e4321be434f598340ff1dcf3d (diff) | |
download | master-187ad058-a59a9bf3a9ae86ea8b6a0c2af93de2d3d526fdbc.tar.gz master-187ad058-a59a9bf3a9ae86ea8b6a0c2af93de2d3d526fdbc.tar.bz2 master-187ad058-a59a9bf3a9ae86ea8b6a0c2af93de2d3d526fdbc.zip |
ead: message handling fixes
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13828 3c298f89-4303-0410-b956-a3cf2f4a3e73
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); |