Changeset 61d2eabb for protocols


Ignore:
Timestamp:
2013-02-14T15:20:00Z (7 years ago)
Author:
Miklos Vajna <vmiklos@…>
Branches:
master
Children:
33ed455
Parents:
b6ab05b
git-author:
Mike Kazantsev <mk.fraggod@…> (14-02-13 15:20:00)
git-committer:
Miklos Vajna <vmiklos@…> (14-02-13 15:20:00)
Message:

skype: check for truncated commands on receiving

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/skype/skype.c

    rb6ab05b r61d2eabb  
    2929#define SKYPE_DEFAULT_SERVER "localhost"
    3030#define SKYPE_DEFAULT_PORT "2727"
    31 #define IRC_LINE_SIZE 1024
     31#define IRC_LINE_SIZE 16384
    3232#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
    3333
     
    11471147        /* Read the whole data. */
    11481148        st = ssl_read(sd->ssl, buf, sizeof(buf));
     1149        if (st >= IRC_LINE_SIZE-1) {
     1150                /* As we don't buffer incoming data, if IRC_LINE_SIZE amount of bytes
     1151                 * were received, there's a good chance last message was truncated
     1152                 * and the next recv() will yield garbage. */
     1153                imcb_error(ic, "Unable to handle incoming data from skyped");
     1154                st = 0;
     1155        }
    11491156        if (st > 0) {
    11501157                buf[st] = '\0';
Note: See TracChangeset for help on using the changeset viewer.