Changeset 13828


Ignore:
Timestamp:
2009-01-03T00:51:57+01:00 (9 years ago)
Author:
nbd
Message:

ead: message handling fixes

Location:
trunk/package/ead/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/ead/src/ead-client.c

    r13738 r13828  
    144144{ 
    145145        struct ead_msg_pong *pong = EAD_DATA(msg, pong); 
    146         int len = msg->len - sizeof(struct ead_msg_pong); 
     146        int len = ntohl(msg->len) - sizeof(struct ead_msg_pong); 
     147 
     148        if (len <= 0) 
     149                return false; 
    147150 
    148151        pong->name[len] = 0; 
  • trunk/package/ead/src/ead.c

    r13738 r13828  
    331331        msg->len = htonl(sizeof(struct ead_msg_pong) + slen); 
    332332        strncpy(pong->name, dev_name, slen); 
    333         pong->name[len] = 0; 
     333        pong->name[slen] = 0; 
    334334        pong->auth_type = htons(EAD_AUTH_MD5); 
    335335 
Note: See TracChangeset for help on using the changeset viewer.