Show
Ignore:
Timestamp:
08/26/99 17:42:07 (15 years ago)
Author:
ucaccsp
Message:

Added loop count to mbus_recv() to avoid denial of service attack.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • common/trunk/src/mbus.c

    r219 r220  
    728728        char            *auth, *ver, *src, *dst, *ack, *r, *cmd, *param, *npos; 
    729729        char            buffer[MBUS_BUF_SIZE]; 
    730         int             buffer_len, seq, i, a, rx, ts, authlen; 
     730        int             buffer_len, seq, i, a, rx, ts, authlen, loop_count; 
    731731        char            ackbuf[MBUS_ACK_BUF_SIZE]; 
    732732        char            digest[16]; 
     
    734734 
    735735        rx = FALSE; 
    736         while (1) { 
     736        loop_count = 0; 
     737        while (loop_count++ < 10) { 
    737738                memset(buffer, 0, MBUS_BUF_SIZE); 
    738739                assert(m->s != NULL); 
     
    883884                mbus_parse_done(m); 
    884885        } 
    885 } 
    886  
     886        return rx; 
     887} 
     888