dont step out-of-bounds in hwaddr_lookup

This commit is contained in:
Doug MacEachern 2005-10-08 02:05:41 +00:00
parent cacd0b97c1
commit ec2e326207
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ static void hwaddr_lookup(sigar_net_interface_config_t *ifconfig, int num)
memset(&ncb.ncb_callname[1], ' ', memset(&ncb.ncb_callname[1], ' ',
sizeof(ncb.ncb_callname)-1); sizeof(ncb.ncb_callname)-1);
ncb.ncb_callname[sizeof(ncb.ncb_callname)] = '\0'; ncb.ncb_callname[sizeof(ncb.ncb_callname)-1] = '\0';
ncb.ncb_buffer = (unsigned char *)&adapter; ncb.ncb_buffer = (unsigned char *)&adapter;
ncb.ncb_length = sizeof(adapter); ncb.ncb_length = sizeof(adapter);