Changeset a2fadb4 in code for icb.h


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.h

    r270fd23 ra2fadb4  
    1818#include <sys/tree.h>
    1919
     20/*
     21 * ICB packet has the following format: <length><type><data>
     22 * <lenght> is one byte length of the packet excluding the <lenght> byte;
     23 * <type> is one byte type of the packet;
     24 * <data> might not be null-terminated.
     25 */
    2026#define ICB_MSGSIZE              256
    2127
     
    7177        char                     client[ICB_MAXNICKLEN];
    7278        char                     host[MAXHOSTNAMELEN];
    73         char                     buffer[ICB_MSGSIZE+1];
     79        char                     buffer[ICB_MSGSIZE];
    7480        struct event             ev;
    7581        struct bufferevent      *bev;
Note: See TracChangeset for help on using the changeset viewer.