luci-lib-ip: fix segfault in link() on systems with ip6gre support
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 25 Jan 2015 20:39:17 +0000 (21:39 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 25 Jan 2015 20:39:17 +0000 (21:39 +0100)
commit0d32e69f163e80442c7a483c445484ee250986e8
treede0c4d4c9b5cd5d85f564a4995b381e4ece58301
parent5317b09be7304cb816b2643fc2cdd52f6f5bbdac
luci-lib-ip: fix segfault in link() on systems with ip6gre support

If an ip6gre interface is queried, the resulting link local address string
of 47 byte overflowed the buffer of 32 bytes used to hold the translated
address.

Increase the address string buffer to 48 byte and check the address length
prior to writing it into the buffer to avoid future problems with longs
link local addresses.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
libs/luci-lib-ip/src/ip.c