diff options
author | mmcc <mmcc@cvs.openbsd.org> | 2016-01-14 18:56:56 +0000 |
---|---|---|
committer | mmcc <mmcc@cvs.openbsd.org> | 2016-01-14 18:56:56 +0000 |
commit | ecdd21652c9aa0c53157d7a06d7ac3d3acfad039 (patch) | |
tree | 33ec4986c8da0657b124a0a906eeaa058fdd2a07 /usr.sbin | |
parent | f6fcfad074cd1e3adac15d8ed616a5c2c529478c (diff) |
Check whether a string from imsg is empty by dereferencing the char*
rather than using strlen. That way we don't have to walk through the
entire string.
ok sunnil@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/mta.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c index dc4e7bfa19b..fe34ecbe739 100644 --- a/usr.sbin/smtpd/mta.c +++ b/usr.sbin/smtpd/mta.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta.c,v 1.199 2015/12/28 22:08:30 jung Exp $ */ +/* $OpenBSD: mta.c,v 1.200 2016/01/14 18:56:55 mmcc Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -517,7 +517,7 @@ mta_imsg(struct mproc *p, struct imsg *imsg) m_get_string(&m, &dom); m_end(&m); source = mta_source((struct sockaddr*)&ss); - if (strlen(dom)) { + if (*dom != '\0') { if (!(strlcpy(buf, dom, sizeof(buf)) >= sizeof(buf))) mta_block(source, buf); @@ -534,7 +534,7 @@ mta_imsg(struct mproc *p, struct imsg *imsg) m_get_string(&m, &dom); m_end(&m); source = mta_source((struct sockaddr*)&ss); - if (strlen(dom)) { + if (*dom != '\0') { if (!(strlcpy(buf, dom, sizeof(buf)) >= sizeof(buf))) mta_unblock(source, buf); |