Changeset a2fadb4 in code for icb.c


Ignore:
Timestamp:
Mar 7, 2014, 3:21:30 PM (11 years ago)
Author:
Mike Belopuhov <mike@…>
Branches:
master
Children:
8871953
Parents:
270fd23
git-author:
Mike Belopuhov <mike@…> (03/07/14 15:17:23)
git-committer:
Mike Belopuhov <mike@…> (03/07/14 15:21:30)
Message:

Get rid of ICB_MSGSIZE+1, fix various off-by-ones and do some truncation
where necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icb.c

    r270fd23 ra2fadb4  
    8282
    8383        is->last = getmonotime();
    84         type = msg[1];
    85         msg += 2;
     84        type = msg[0];
     85        msg++;
    8686        if (!ISSETF(is->flags, ICB_SF_LOGGEDIN) && type != ICB_M_LOGIN) {
    8787                icb_error(is, "Not logged in");
     
    378378    const char *fmt, ...)
    379379{
    380         char buf[ICB_MSGSIZE];
     380        char buf[ICB_MSGSIZE - 10]; /* truncate to make sure all fits */
    381381        va_list ap;
    382382        struct icb_session *s;
     
    481481icb_dowho(struct icb_session *is, struct icb_group *ig)
    482482{
    483         char buf[ICB_MSGSIZE];
     483        char buf[ICB_MSGSIZE - 10]; /* truncate to make sure all fits */
    484484        struct icb_session *s;
    485485        int nusers = 0;
     
    510510icb_who(struct icb_session *is, struct icb_group *ig)
    511511{
    512         char buf[ICB_MSGSIZE];
     512        char buf[ICB_MSGSIZE - 10]; /* truncate to make sure all fits */
    513513        struct icb_group *g;
    514514
Note: See TracChangeset for help on using the changeset viewer.