[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] Compile error in 1.4.0
From: |
qxc |
Subject: |
[lwip-devel] Compile error in 1.4.0 |
Date: |
Fri, 24 Feb 2012 10:58:02 +0100 |
Hi,
I don't know if it is a known problem but I stumbled upon this:
In dhcp.c line 1683 my compiler fails with an error here:
for (i = 0; i < DHCP_CHADDR_LEN; i++) {
/* copy netif hardware address, pad with zeroes */
dhcp->msg_out->chaddr[i] = (i < netif->hwaddr_len) ? netif->hwaddr[i] : 0/*
pad byte*/;
}
The reason is clear, DHCP_CHADDR_LEN is defined as 16 while netif->hwaddr[i]
has a maximum length of 6 so this compiler error is quite correct. The
construct "(i < netif->hwaddr_len)" avoids that the array bounds are exceeded
during runtime but what is the strategy to compile this? Wouldn't it be better
to replace this construct by a more secure one the compiler is happy with?
Oxy
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
- [lwip-devel] Compile error in 1.4.0,
qxc <=