Changeset 927d0c70c763dcf56e6f12ebe02a51688468a5c3 for src/rh-ipset.c
- Timestamp:
- 06/08/09 21:12:46 (3 years ago)
- Children:
- bae014d9f22e13f6115d53d154e6489f20ae00e4
- Parents:
- 5987af1b79b0c1fbd4aa9d30a53ec6879853ece3
- git-committer:
- Neutron Soutmun <neo.neutron@…> (06/08/09 21:12:46)
- Files:
-
- 1 modified
-
src/rh-ipset.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/rh-ipset.c
raace70f r927d0c7 122 122 req_adt_get.op = IP_SET_OP_ADT_GET; 123 123 req_adt_get.version = IP_SET_PROTOCOL_VERSION; 124 str cpy(req_adt_get.set.name, name);124 strncpy(req_adt_get.set.name, name, IP_SET_MAXNAMELEN); 125 125 size = sizeof(struct ip_set_req_adt_get); 126 126 … … 150 150 { 151 151 unsigned int i = 0; 152 if (!mac) 153 return; 154 152 155 if (strlen(mac) != ETH_ALEN * 3 - 1) 153 156 return; … … 181 184 static char mac_string[18] = ""; 182 185 183 s printf(mac_string, "%02X:%02X:%02X:%02X:%02X:%02X",186 snprintf(mac_string, sizeof (mac_string), "%02X:%02X:%02X:%02X:%02X:%02X", 184 187 macaddress[0], macaddress[1], macaddress[2], 185 188 macaddress[3], macaddress[4], macaddress[5]); … … 261 264 req.op = IP_SET_OP_FLUSH; 262 265 req.version = IP_SET_PROTOCOL_VERSION; 263 str cpy(req.name, name);266 strncpy(req.name, name, IP_SET_MAXNAMELEN); 264 267 265 268 kernel_sendto(&req, sizeof(struct ip_set_req_std)); … … 288 291 req_max_sets.op = IP_SET_OP_MAX_SETS; 289 292 req_max_sets.version = IP_SET_PROTOCOL_VERSION; 290 str cpy(req_max_sets.set.name, name);293 strncpy(req_max_sets.set.name, name, IP_SET_MAXNAMELEN); 291 294 size = sizeof(req_max_sets); 292 295 kernel_getfrom(&req_max_sets, &size);
