Signed-off-by: Wolfram Sang <w.sang@xxxxxxxxxxxxxx> --- net/net.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/net/net.c b/net/net.c index f1ab667..3578118 100644 --- a/net/net.c +++ b/net/net.c @@ -113,8 +113,10 @@ int string_to_ip(const char *s, IPaddr_t *ip) return -EINVAL; val = simple_strtoul(s, &e, 10); - addr <<= 8; - addr |= (val & 0xFF); + if (val > 255) + return -EINVAL; + + addr = (addr << 8) | val; if (*e != '.' && i != 3) return -EINVAL; -- 1.7.5.4 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox