[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH] Buffer ueberlauf bei h_addr_list[i] = NULL;



---
 src/modules/lib/posix/net.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/modules/lib/posix/net.c b/src/modules/lib/posix/net.c
index 9cc9b35..d1c4c6b 100644
--- a/src/modules/lib/posix/net.c
+++ b/src/modules/lib/posix/net.c
@@ -233,7 +233,7 @@ struct hostent* gethostbyname(const char* name)
             uint32_t* ip_q = malloc(sizeof(uint32_t));
             *ip_q = string_to_ip(p);
 
-            h_addr_list = realloc(h_addr_list, sizeof(uint32_t*) * (i + 1));
+            h_addr_list = realloc(h_addr_list, sizeof(uint32_t*) * (i + 2));
             h_addr_list[i] = ip_q;
             i++;
 
-- 
1.6.0.4