Changeset 2483 for neercs/trunk


Ignore:
Timestamp:
Jun 24, 2008, 3:21:35 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Fix a buffer overflow in the reattach code.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/attach.c

    r2482 r2483  
    104104}
    105105
    106 /* FIXME Is this really not defined anywhere ? */
    107 #define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
    108 
    109106static int handle_command(char * cmd, struct screen_list* screen_list, cucul_canvas_t * cv, caca_display_t ** dp)
    110107{
    111108    int refresh = 0;
    112109    debug("Received command %s", cmd);
    113     if(!strncmp("ENV ", cmd, MIN(4, strlen(cmd))))
     110    if(!strncmp("ENV ", cmd, 4))
    114111    {
    115112        putenv(strdup(cmd+4));
    116113    }
    117     else if(!strncmp("ATTACH ", cmd, MIN(7, strlen(cmd))))
     114    else if(!strncmp("ATTACH ", cmd, 7))
    118115    {
    119116        int fd;
Note: See TracChangeset for help on using the changeset viewer.