aboutsummaryrefslogtreecommitdiffstats
path: root/package/ead/src/ead-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'package/ead/src/ead-client.c')
-rw-r--r--package/ead/src/ead-client.c5
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);