Changeset 14569


Ignore:
Timestamp:
Oct 5, 2015, 11:10:52 PM (6 years ago)
Author:
mikedld
Message:

#5732: Change length argument type to uint32_t for LTEP messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-msgs.c

    r14568 r14569  
    984984
    985985static void
    986 parseLtepHandshake (tr_peerMsgs * msgs, int len, struct evbuffer * inbuf)
     986parseLtepHandshake (tr_peerMsgs * msgs, uint32_t len, struct evbuffer * inbuf)
    987987{
    988988    int64_t   i;
     
    10061006    }
    10071007
    1008     dbgmsg (msgs, "here is the handshake: [%*.*s]", len, len,  tmp);
     1008    /* arbitrary limit, should be more than enough */
     1009    if (len <= 4096)
     1010      dbgmsg (msgs, "here is the handshake: [%*.*s]", (int) len, (int) len, tmp);
     1011    else
     1012      dbgmsg (msgs, "handshake length is too big (%" PRIu32 "), printing skipped", len);
    10091013
    10101014    /* does the peer prefer encrypted connections? */
     
    10841088
    10851089static void
    1086 parseUtMetadata (tr_peerMsgs * msgs, int msglen, struct evbuffer * inbuf)
     1090parseUtMetadata (tr_peerMsgs * msgs, uint32_t msglen, struct evbuffer * inbuf)
    10871091{
    10881092    tr_variant dict;
     
    11611165
    11621166static void
    1163 parseUtPex (tr_peerMsgs * msgs, int msglen, struct evbuffer * inbuf)
     1167parseUtPex (tr_peerMsgs * msgs, uint32_t msglen, struct evbuffer * inbuf)
    11641168{
    11651169    int loaded = 0;
     
    12261230
    12271231static void
    1228 parseLtep (tr_peerMsgs * msgs, int msglen, struct evbuffer * inbuf)
     1232parseLtep (tr_peerMsgs * msgs, uint32_t msglen, struct evbuffer * inbuf)
    12291233{
    12301234    uint8_t ltep_msgid;
     1235
     1236    assert (msglen > 0);
    12311237
    12321238    tr_peerIoReadUint8 (msgs->io, inbuf, &ltep_msgid);
Note: See TracChangeset for help on using the changeset viewer.