From: michael Date: Tue, 23 Dec 2014 20:57:35 +0000 (+0000) Subject: - firedns.c: replaced strncpy() with strlcpy() X-Git-Tag: 1.0.0beta1~41 X-Git-Url: http://git.serene-ircd.net/?a=commitdiff_plain;h=5b9573670b2cb5690132b0f3f2ba6fbb152a1611;p=hopm.git - firedns.c: replaced strncpy() with strlcpy() git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@5097 82007160-df01-0410-b94d-b575c5fd34c7 --- diff --git a/src/firedns.c b/src/firedns.c index 2d3c0b8..fab8288 100644 --- a/src/firedns.c +++ b/src/firedns.c @@ -319,7 +319,7 @@ int firedns_getip(int type, const char * const name, void *info) s->class = 1; s->type = type; - strncpy(s->lookup, name, 256); + strlcpy(s->lookup, name, sizeof(s->lookup)); s->info = info; if(fdns_fdinuse >= OptionsItem->dns_fdlimit) @@ -597,7 +597,7 @@ struct firedns_result *firedns_getresult(const int fd) l = recv(c->fd,&h,sizeof(struct s_header),0); result.info = (void *) c->info; - strncpy(result.lookup, c->lookup, 256); + strlcpy(result.lookup, c->lookup, sizeof(result.lookup)); if(l == -1) { @@ -756,7 +756,7 @@ void firedns_cycle(void) memset(new_result.text, 0, sizeof(new_result.text)); new_result.info = p->info; - strncpy(new_result.lookup, p->lookup, 256); + strlcpy(new_result.lookup, p->lookup, sizeof(new_result.lookup)); close(p->fd); fdns_fdinuse--;