From 855ea02b1556dd9c250fd69c3c0529ef045ab04b Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 3 Feb 2017 10:07:48 +0800 Subject: [PATCH] netdb: Use LWIP_MEM_ALIGN_BUFFER instead of open coded Signed-off-by: Axel Lin --- src/api/netdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/netdb.c b/src/api/netdb.c index ccd9586f..f551412c 100644 --- a/src/api/netdb.c +++ b/src/api/netdb.c @@ -187,7 +187,7 @@ lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf, } namelen = strlen(name); - if (buflen < (sizeof(struct gethostbyname_r_helper) + namelen + 1 + (MEM_ALIGNMENT - 1))) { + if (buflen < (sizeof(struct gethostbyname_r_helper) + LWIP_MEM_ALIGN_BUFFER(namelen + 1))) { /* buf can't hold the data needed + a copy of name */ *h_errnop = ERANGE; return -1;