Ignore:
Timestamp:
Apr 28, 2011, 1:07:43 AM (10 years ago)
Author:
Sam Hocevar
Message:

core: fix a few security issues caused by unchecked string operations,
reported in ticket #25.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/innet.cpp

    r524 r545  
    8888        {
    8989            i++;
    90             strcpy( main_net_cfg->server_name, argv[i] );
     90            strncpy(main_net_cfg->server_name, argv[i],
     91                    sizeof(main_net_cfg->server_name) - 1);
     92            main_net_cfg->server_name[sizeof(main_net_cfg->server_name) - 1]
     93                = '\0';
    9194            main_net_cfg->state = net_configuration::CLIENT;
    9295        }
Note: See TracChangeset for help on using the changeset viewer.