1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

dhcp: fix buffer-overflow for addresses

Fix trivial buffer-overflow which caused configuration overwrites.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
David Herrmann 2014-02-17 12:18:55 +01:00
parent 36da68594b
commit 024ea8c733

View file

@ -709,7 +709,7 @@ static int make_address(char *buf, const char *prefix, const char *suffix,
goto error;
inet_ntop(AF_INET, &addr, buf, INET_ADDRSTRLEN);
buf[INET_ADDRSTRLEN] = 0;
buf[INET_ADDRSTRLEN - 1] = 0;
return 0;
error:
@ -728,7 +728,7 @@ static int make_subnet(char *buf, const char *subnet)
goto error;
inet_ntop(AF_INET, &addr, buf, INET_ADDRSTRLEN);
buf[INET_ADDRSTRLEN] = 0;
buf[INET_ADDRSTRLEN - 1] = 0;
return 0;
error: