Commit bc57d757 authored by Paul Eggert's avatar Paul Eggert
Browse files

* process.c (Fnetwork_interface_info): Avoid possibility of int overflow.

parent afd4052b
......@@ -3,6 +3,7 @@
* process.c (list_processes_1, create_pty, read_process_output):
(exec_sentinel): Remove vars that were set but not used.
(create_pty): Remove unnecessary "volatile"s.
(Fnetwork_interface_info): Avoid possibility of int overflow.
* bytecode.c (exec_byte_code): Rename local to avoid shadowing.
......@@ -3949,7 +3949,7 @@ FLAGS is the current flags of the interface. */)
const struct ifflag_def *fp;
int fnum;
any++;
any = 1;
for (fp = ifflag_table; flags != 0 && fp->flag_sym; fp++)
{
if (flags & fp->flag_bit)
......@@ -3977,7 +3977,7 @@ FLAGS is the current flags of the interface. */)
register struct Lisp_Vector *p = XVECTOR (hwaddr);
int n;
any++;
any = 1;
for (n = 0; n < 6; n++)
p->contents[n] = make_number (((unsigned char *)&rq.ifr_hwaddr.sa_data[0])[n]);
elt = Fcons (make_number (rq.ifr_hwaddr.sa_family), hwaddr);
......@@ -3989,7 +3989,7 @@ FLAGS is the current flags of the interface. */)
#if defined(SIOCGIFNETMASK) && (defined(HAVE_STRUCT_IFREQ_IFR_NETMASK) || defined(HAVE_STRUCT_IFREQ_IFR_ADDR))
if (ioctl (s, SIOCGIFNETMASK, &rq) == 0)
{
any++;
any = 1;
#ifdef HAVE_STRUCT_IFREQ_IFR_NETMASK
elt = conv_sockaddr_to_lisp (&rq.ifr_netmask, sizeof (rq.ifr_netmask));
#else
......@@ -4003,7 +4003,7 @@ FLAGS is the current flags of the interface. */)
#if defined(SIOCGIFBRDADDR) && defined(HAVE_STRUCT_IFREQ_IFR_BROADADDR)
if (ioctl (s, SIOCGIFBRDADDR, &rq) == 0)
{
any++;
any = 1;
elt = conv_sockaddr_to_lisp (&rq.ifr_broadaddr, sizeof (rq.ifr_broadaddr));
}
#endif
......@@ -4013,7 +4013,7 @@ FLAGS is the current flags of the interface. */)
#if defined(SIOCGIFADDR) && defined(HAVE_STRUCT_IFREQ_IFR_ADDR)
if (ioctl (s, SIOCGIFADDR, &rq) == 0)
{
any++;
any = 1;
elt = conv_sockaddr_to_lisp (&rq.ifr_addr, sizeof (rq.ifr_addr));
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment