-/* $OpenBSD: ber.c,v 1.3 2013/01/26 09:37:23 gilles Exp $ */
+/* $OpenBSD: ber.c,v 1.4 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net>
return NULL;
}
- bcopy(string0, string, len);
+ memmove(string, string0, len);
elm->be_val = string;
elm->be_len = len;
elm->be_free = 1; /* free string on cleanup */
return NULL;
}
- bcopy(v0, v, len);
+ memmove(v, v0, len);
elm->be_val = v;
elm->be_len = len;
elm->be_free = 1; /* free string on cleanup */
if (strlcpy(str, oidstr, sizeof(str)) >= sizeof(str))
return (-1);
- bzero(o, sizeof(*o));
+ memset(o, 0, sizeof(*o));
/* Parse OID strings in the common forms n.n.n, n_n_n_n, or n-n-n */
for (p = sp = str; p != NULL; sp = p) {
if (n > BER_MAX_OID_LEN)
return (NULL);
no.bo_n = n;
- bcopy(&o->bo_id, &no.bo_id, sizeof(no.bo_id));
+ memmove(&no.bo_id, &o->bo_id, sizeof(no.bo_id));
return (ber_add_oid(prev, &no));
}
if (!buf[i])
return (-1);
- bzero(o, sizeof(*o));
+ memset(o, 0, sizeof(*o));
o->bo_id[j++] = buf[i] / 40;
o->bo_id[j++] = buf[i++] % 40;
for (; i < len && j < BER_MAX_OID_LEN; i++) {
struct ber_oid *o;
struct ber_element *parent[_MAX_SEQ], **e;
- bzero(parent, sizeof(struct ber_element *) * _MAX_SEQ);
+ memset(parent, 0, sizeof(struct ber_element *) * _MAX_SEQ);
va_start(ap, fmt);
while (*fmt) {
ber_write(struct ber *ber, void *buf, size_t len)
{
if (ber->br_wptr + len <= ber->br_wend)
- bcopy(buf, ber->br_wptr, len);
+ memmove(ber->br_wptr, buf, len);
+
ber->br_wptr += len;
}
return (-1); /* end of buffer and parser wants more data */
}
- bcopy(b->br_rptr, buf, len);
+ memmove(buf, b->br_rptr, len);
b->br_rptr += len;
return (len);
-/* $OpenBSD: config.c,v 1.21 2013/11/18 11:47:16 eric Exp $ */
+/* $OpenBSD: config.c,v 1.22 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
}
if (what & PURGE_SSL) {
while (dict_poproot(env->sc_ssl_dict, (void **)&s)) {
- bzero(s->ssl_cert, s->ssl_cert_len);
- bzero(s->ssl_key, s->ssl_key_len);
+ memset(s->ssl_cert, 0, s->ssl_cert_len);
+ memset(s->ssl_key, 0, s->ssl_key_len);
free(s->ssl_cert);
free(s->ssl_key);
free(s);
-/* $OpenBSD: control.c,v 1.93 2013/12/06 14:12:34 eric Exp $ */
+/* $OpenBSD: control.c,v 1.94 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2012 Gilles Chehade <gilles@poolp.org>
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
fatal("control: socket");
- bzero(&sun, sizeof(sun));
+ memset(&sun, 0, sizeof(sun));
sun.sun_family = AF_UNIX;
if (strlcpy(sun.sun_path, SMTPD_SOCKET,
sizeof(sun.sun_path)) >= sizeof(sun.sun_path))
tree_init(&ctl_conns);
- bzero(&digest, sizeof digest);
+ memset(&digest, 0, sizeof digest);
digest.startup = time(NULL);
config_peer(PROC_SCHEDULER);
-/* $OpenBSD: crypto.c,v 1.3 2013/07/22 13:20:49 eric Exp $ */
+/* $OpenBSD: crypto.c,v 1.4 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2013 Gilles Chehade <gilles@openbsd.org>
if (len != KEY_SIZE)
return 0;
- bzero(&cp, sizeof cp);
+ memset(&cp, 0, sizeof cp);
cp.cipher = EVP_aes_256_gcm();
/* openssl rand -hex 16 */
-/* $OpenBSD: delivery_lmtp.c,v 1.3 2013/10/26 12:27:58 eric Exp $ */
+/* $OpenBSD: delivery_lmtp.c,v 1.4 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2013 Ashish SHUKLA <ashish.is@lostca.se>
hostname = address;
s = -1;
- bzero(&hints, sizeof(hints));
+ memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_NUMERICSERV;
struct sockaddr_un addr;
int s;
- bzero(&addr, sizeof(addr));
+ memset(&addr, 0, sizeof(addr));
if ((s = socket(PF_LOCAL, SOCK_STREAM, 0)) == -1) {
warn("socket");
-/* $OpenBSD: dns.c,v 1.69 2013/11/18 11:55:41 eric Exp $ */
+/* $OpenBSD: dns.c,v 1.70 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
return (0);
buf[l - 1] = '\0';
- bzero(&hints, sizeof(hints));
+ memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_NUMERICHOST;
hints.ai_socktype = SOCK_STREAM;
if (i6)
-/* $OpenBSD: enqueue.c,v 1.73 2013/12/06 14:26:25 eric Exp $ */
+/* $OpenBSD: enqueue.c,v 1.74 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2005 Henning Brauer <henning@bulabula.org>
int save_argc;
char **save_argv;
- bzero(&msg, sizeof(msg));
+ memset(&msg, 0, sizeof(msg));
time(×tamp);
save_argc = argc;
uint i, cur = HDR_NONE;
uint header_seen = 0, header_done = 0;
- bzero(&pstate, sizeof(pstate));
+ memset(&pstate, 0, sizeof(pstate));
for (;;) {
buf = fgetln(fin, &len);
if (buf == NULL && ferror(fin))
-/* $OpenBSD: envelope.c,v 1.25 2013/12/05 09:44:16 eric Exp $ */
+/* $OpenBSD: envelope.c,v 1.26 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
size_t len;
char *buf, *field, *nextline;
- bzero(lbuf, sizeof lbuf);
+ memset(lbuf, 0, sizeof lbuf);
if (strlcpy(lbuf, ibuf, sizeof lbuf) >= sizeof lbuf)
goto err;
buf = lbuf;
goto end;
}
- bzero(ep, sizeof *ep);
+ memset(ep, 0, sizeof *ep);
ret = envelope_ascii_load(ep, &d);
if (ret)
ep->version = SMTPD_ENVELOPE_VERSION;
struct sockaddr_in6 ssin6;
struct sockaddr_in ssin;
- bzero(&ssin, sizeof ssin);
- bzero(&ssin6, sizeof ssin6);
+ memset(&ssin, 0, sizeof ssin);
+ memset(&ssin6, 0, sizeof ssin6);
if (!strcmp("local", buf)) {
ss->ss_family = AF_LOCAL;
if (*dest == NULL)
return;
- bzero(buf, sizeof buf);
+ memset(buf, 0, sizeof buf);
if (! ascii_dump_field(field, ep, buf, sizeof buf))
goto err;
if (buf[0] == '\0')
-/* $OpenBSD: expand.c,v 1.24 2013/10/24 20:39:23 eric Exp $ */
+/* $OpenBSD: expand.c,v 1.25 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2009 Gilles Chehade <gilles@poolp.org>
int esc, i, dq, sq;
char *s;
- bzero(buffer, sizeof buffer);
+ memset(buffer, 0, sizeof buffer);
esc = dq = sq = i = 0;
for (s = *line; (*s) && (i < (int)sizeof(buffer)); ++s) {
if (esc) {
char *p, *subrcpt;
int ret;
- bzero(buffer, sizeof buffer);
+ memset(buffer, 0, sizeof buffer);
if (strlcpy(buffer, s, sizeof buffer) >= sizeof buffer)
return 0;
-/* $OpenBSD: filter_api.c,v 1.11 2013/11/06 10:12:07 eric Exp $ */
+/* $OpenBSD: filter_api.c,v 1.12 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
tree_init(&sessions);
event_init();
- bzero(&fi, sizeof(fi));
+ memset(&fi, 0, sizeof(fi));
fi.p.proc = PROC_MFA;
fi.p.name = "filter";
fi.p.handler = filter_dispatch;
-/* $OpenBSD: ioev.c,v 1.14 2013/10/26 12:27:59 eric Exp $ */
+/* $OpenBSD: ioev.c,v 1.15 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
{
struct linger l;
- bzero(&l, sizeof(l));
+ memset(&l, 0, sizeof(l));
l.l_onoff = linger ? 1 : 0;
l.l_linger = linger;
if (setsockopt(fd, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) == -1)
-/* $OpenBSD: lka_session.c,v 1.61 2013/11/19 10:22:42 eric Exp $ */
+/* $OpenBSD: lka_session.c,v 1.62 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@poolp.org>
lks->envelope = *envelope;
TAILQ_INIT(&lks->nodes);
- bzero(&xn, sizeof xn);
+ memset(&xn, 0, sizeof xn);
xn.type = EXPAND_ADDRESS;
xn.u.mailaddr = lks->envelope.rcpt;
lks->expand.rule = NULL;
lks->expand.rule = rule;
lks->expand.parent = xn;
lks->expand.alias = 1;
- bzero(&node, sizeof node);
+ memset(&node, 0, sizeof node);
node.type = EXPAND_USERNAME;
mailaddr_to_username(&xn->u.mailaddr, node.u.user,
sizeof node.u.user);
lks->rule = rule;
lks->node = xn;
- bzero(&fwreq, sizeof(fwreq));
+ memset(&fwreq, 0, sizeof(fwreq));
fwreq.id = lks->id;
(void)strlcpy(fwreq.user, lk.userinfo.username, sizeof(fwreq.user));
(void)strlcpy(fwreq.directory, lk.userinfo.directory, sizeof(fwreq.directory));
strlcpy(ep->agent.mda.buffer, rule->r_value.buffer,
sizeof ep->agent.mda.buffer);
- bzero(tag, sizeof tag);
+ memset(tag, 0, sizeof tag);
if (! mailaddr_tag(&ep->dest, tag, sizeof tag)) {
lks->error = LKA_PERMFAIL;
free(ep);
if (len < sizeof tmpbuf)
fatalx("lka_expand_format: tmp buffer < rule buffer");
- bzero(tmpbuf, sizeof tmpbuf);
+ memset(tmpbuf, 0, sizeof tmpbuf);
pbuf = buf;
ptmp = tmpbuf;
ret = tmpret = 0;
-/* $OpenBSD: makemap.c,v 1.47 2013/11/28 10:43:37 eric Exp $ */
+/* $OpenBSD: makemap.c,v 1.48 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
void
purge_config(uint8_t what)
{
- bzero(env, sizeof(struct smtpd));
+ memset(env, 0, sizeof(struct smtpd));
}
int
-/* $OpenBSD: mda.c,v 1.99 2013/11/28 10:43:37 eric Exp $ */
+/* $OpenBSD: mda.c,v 1.100 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
/* request parent to fork a helper process */
userinfo = &s->user->userinfo;
- bzero(&deliver, sizeof deliver);
+ memset(&deliver, 0, sizeof deliver);
switch (e->method) {
case A_MDA:
deliver.mode = A_MDA;
char *ln, buf[SMTPD_MAXLINESIZE];
size_t len;
- bzero(buf, sizeof buf);
+ memset(buf, 0, sizeof buf);
if (lseek(fd, 0, SEEK_SET) < 0) {
log_warn("warn: mda: lseek");
close(fd);
-/* $OpenBSD: mproc.c,v 1.6 2013/11/21 08:35:54 eric Exp $ */
+/* $OpenBSD: mproc.c,v 1.7 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@faurot.net>
char buf[CMSG_SPACE(sizeof(int))];
} cmsgbuf;
- bzero(&iov, sizeof(iov));
- bzero(&msg, sizeof(msg));
+ memset(&iov, 0, sizeof(iov));
+ memset(&msg, 0, sizeof(msg));
TAILQ_FOREACH(buf, &msgbuf->bufs, entry) {
if (i >= IOV_MAX)
break;
-/* $OpenBSD: mta.c,v 1.177 2013/12/06 14:12:34 eric Exp $ */
+/* $OpenBSD: mta.c,v 1.178 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
{
struct mta_relay key, *r;
- bzero(&key, sizeof key);
+ memset(&key, 0, sizeof key);
if (e->agent.mta.relay.flags & RELAY_BACKUP) {
key.domain = mta_domain(e->dest.domain, 0);
-/* $OpenBSD: mta_session.c,v 1.49 2013/12/03 09:06:26 eric Exp $ */
+/* $OpenBSD: mta_session.c,v 1.50 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
fatal("mta: ssl_mta_init");
io_start_tls(&s->io, ssl);
- bzero(resp_ca_cert->cert, resp_ca_cert->cert_len);
- bzero(resp_ca_cert->key, resp_ca_cert->key_len);
+ memset(resp_ca_cert->cert, 0, resp_ca_cert->cert_len);
+ memset(resp_ca_cert->key, 0, resp_ca_cert->key_len);
free(resp_ca_cert->cert);
free(resp_ca_cert->key);
free(resp_ca_cert);
break;
case MTA_AUTH_LOGIN_USER:
- bzero(ibuf, sizeof ibuf);
+ memset(ibuf, 0, sizeof ibuf);
if (__b64_pton(s->relay->secret, (unsigned char *)ibuf, sizeof(ibuf)-1) == -1) {
log_debug("debug: mta: %p: credentials too large on session", s);
mta_error(s, "Credentials too large");
break;
}
- bzero(obuf, sizeof obuf);
+ memset(obuf, 0, sizeof obuf);
__b64_ntop((unsigned char *)ibuf + 1, strlen(ibuf + 1), obuf, sizeof obuf);
mta_send(s, "%s", obuf);
- bzero(ibuf, sizeof ibuf);
- bzero(obuf, sizeof obuf);
+ memset(ibuf, 0, sizeof ibuf);
+ memset(obuf, 0, sizeof obuf);
break;
case MTA_AUTH_LOGIN_PASS:
- bzero(ibuf, sizeof ibuf);
+ memset(ibuf, 0, sizeof ibuf);
if (__b64_pton(s->relay->secret, (unsigned char *)ibuf, sizeof(ibuf)-1) == -1) {
log_debug("debug: mta: %p: credentials too large on session", s);
mta_error(s, "Credentials too large");
}
offset = strlen(ibuf+1)+2;
- bzero(obuf, sizeof obuf);
+ memset(obuf, 0, sizeof obuf);
__b64_ntop((unsigned char *)ibuf + offset, strlen(ibuf + offset), obuf, sizeof obuf);
mta_send(s, "%s", obuf);
- bzero(ibuf, sizeof ibuf);
- bzero(obuf, sizeof obuf);
+ memset(ibuf, 0, sizeof ibuf);
+ memset(obuf, 0, sizeof obuf);
break;
case MTA_READY:
s->flags |= MTA_WAIT;
/* Send the client certificate */
- bzero(&req_ca_vrfy, sizeof req_ca_vrfy);
+ memset(&req_ca_vrfy, 0, sizeof req_ca_vrfy);
if (s->relay->cert)
pkiname = s->relay->cert;
else
if (xchain) {
/* Send the chain, one cert at a time */
for (i = 0; i < sk_X509_num(xchain); ++i) {
- bzero(&req_ca_vrfy, sizeof req_ca_vrfy);
+ memset(&req_ca_vrfy, 0, sizeof req_ca_vrfy);
req_ca_vrfy.reqid = s->id;
x = sk_X509_value(xchain, i);
req_ca_vrfy.cert_len = i2d_X509(x, &req_ca_vrfy.cert);
}
/* Tell lookup process that it can start verifying, we're done */
- bzero(&req_ca_vrfy, sizeof req_ca_vrfy);
+ memset(&req_ca_vrfy, 0, sizeof req_ca_vrfy);
req_ca_vrfy.reqid = s->id;
m_compose(p_lka, IMSG_LKA_SSL_VERIFY, 0, 0, -1,
&req_ca_vrfy, sizeof req_ca_vrfy);
-/* $OpenBSD: parse.y,v 1.134 2013/12/05 15:04:09 eric Exp $ */
+/* $OpenBSD: parse.y,v 1.135 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
;
main : BOUNCEWARN {
- bzero(conf->sc_bounce_warn, sizeof conf->sc_bounce_warn);
+ memset(conf->sc_bounce_warn, 0, sizeof conf->sc_bounce_warn);
} bouncedelays
| QUEUE COMPRESSION {
conf->sc_queue_flags |= QUEUE_COMPRESSION;
YYERROR;
}
conf->sc_queue_key = strdup(password);
- bzero(password, strlen(password));
+ memset(password, 0, strlen(password));
if (conf->sc_queue_key == NULL) {
yyerror("memory exhausted");
YYERROR;
} limits_mta
| LIMIT SCHEDULER limits_scheduler
| LISTEN {
- bzero(&l, sizeof l);
- bzero(&listen_opts, sizeof listen_opts);
+ memset(&l, 0, sizeof l);
+ memset(&listen_opts, 0, sizeof listen_opts);
listen_opts.family = AF_UNSPEC;
} ON STRING listen {
listen_opts.ifx = $4;
return (-1);
conf = x_conf;
- bzero(conf, sizeof(*conf));
+ memset(conf, 0, sizeof(*conf));
strlcpy(conf->sc_hostname, hostname, sizeof(conf->sc_hostname));
struct sockaddr_in *sain;
struct listener *h;
- bzero(&ina, sizeof(ina));
+ memset(&ina, 0, sizeof(ina));
if (inet_pton(AF_INET, s, &ina) != 1)
return (NULL);
struct sockaddr_in6 *sin6;
struct listener *h;
- bzero(&ina6, sizeof(ina6));
+ memset(&ina6, 0, sizeof(ina6));
if (inet_pton(AF_INET6, s, &ina6) != 1)
return (NULL);
struct sockaddr_in6 *sin6;
struct listener *h;
- bzero(&hints, sizeof(hints));
+ memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM; /* DUMMY */
error = getaddrinfo(lo->ifx, NULL, &hints, &res0);
-/* $OpenBSD: queue_fs.c,v 1.3 2013/11/06 10:07:29 eric Exp $ */
+/* $OpenBSD: queue_fs.c,v 1.4 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2011 Gilles Chehade <gilles@poolp.org>
hdl = fsqueue_qwalk_new();
if (fsqueue_qwalk(hdl, evpid)) {
- bzero(buf, len);
+ memset(buf, 0, len);
r = queue_fs_envelope_load(*evpid, buf, len);
if (r) {
msgid = evpid_to_msgid(*evpid);
-/* $OpenBSD: scheduler.c,v 1.39 2013/12/05 09:26:47 eric Exp $ */
+/* $OpenBSD: scheduler.c,v 1.40 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
!(env->sc_flags & SMTPD_MTA_PAUSED))
typemask |= SCHED_MTA;
- bzero(&batch, sizeof (batch));
+ memset(&batch, 0, sizeof (batch));
batch.evpids = evpids;
batch.evpcount = env->sc_scheduler_max_schedule;
backend->batch(typemask, &batch);
-/* $OpenBSD: scheduler_ramqueue.c,v 1.35 2013/12/05 09:26:47 eric Exp $ */
+/* $OpenBSD: scheduler_ramqueue.c,v 1.36 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2012 Gilles Chehade <gilles@poolp.org>
static void
rq_queue_init(struct rq_queue *rq)
{
- bzero(rq, sizeof *rq);
+ memset(rq, 0, sizeof *rq);
tree_init(&rq->messages);
TAILQ_INIT(&rq->q_pending);
TAILQ_INIT(&rq->q_inflight);
-/* $OpenBSD: smtp_session.c,v 1.191 2013/11/28 12:39:23 eric Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.192 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
io_set_read(&s->io);
io_start_tls(&s->io, ssl);
- bzero(resp_ca_cert->cert, resp_ca_cert->cert_len);
- bzero(resp_ca_cert->key, resp_ca_cert->key_len);
+ memset(resp_ca_cert->cert, 0, resp_ca_cert->cert_len);
+ memset(resp_ca_cert->key, 0, resp_ca_cert->key_len);
free(resp_ca_cert->cert);
free(resp_ca_cert->key);
free(resp_ca_cert);
return;
case STATE_AUTH_USERNAME:
- bzero(s->username, sizeof(s->username));
+ memset(s->username, 0, sizeof(s->username));
if (__b64_pton(arg, (unsigned char *)s->username,
sizeof(s->username) - 1) == -1)
goto abort;
return;
case STATE_AUTH_PASSWORD:
- bzero(buf, sizeof(buf));
+ memset(buf, 0, sizeof(buf));
if (__b64_pton(arg, (unsigned char *)buf, sizeof(buf)-1) == -1)
goto abort;
free(rcpt);
}
- bzero(&s->evp, sizeof s->evp);
+ memset(&s->evp, 0, sizeof s->evp);
s->msgflags = 0;
s->destcount = 0;
s->rcptcount = 0;
tree_xset(&wait_ssl_verify, s->id, s);
/* Send the client certificate */
- bzero(&req_ca_vrfy, sizeof req_ca_vrfy);
+ memset(&req_ca_vrfy, 0, sizeof req_ca_vrfy);
if (strlcpy(req_ca_vrfy.pkiname, s->listener->ssl_cert_name, sizeof req_ca_vrfy.pkiname)
>= sizeof req_ca_vrfy.pkiname)
return 0;
if (xchain) {
/* Send the chain, one cert at a time */
for (i = 0; i < sk_X509_num(xchain); ++i) {
- bzero(&req_ca_vrfy, sizeof req_ca_vrfy);
+ memset(&req_ca_vrfy, 0, sizeof req_ca_vrfy);
req_ca_vrfy.reqid = s->id;
x = sk_X509_value(xchain, i);
req_ca_vrfy.cert_len = i2d_X509(x, &req_ca_vrfy.cert);
}
/* Tell lookup process that it can start verifying, we're done */
- bzero(&req_ca_vrfy, sizeof req_ca_vrfy);
+ memset(&req_ca_vrfy, 0, sizeof req_ca_vrfy);
req_ca_vrfy.reqid = s->id;
m_compose(p_lka, IMSG_LKA_SSL_VERIFY, 0, 0, -1,
&req_ca_vrfy, sizeof req_ca_vrfy);
-/* $OpenBSD: smtpctl.c,v 1.113 2013/11/13 09:15:41 eric Exp $ */
+/* $OpenBSD: smtpctl.c,v 1.114 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
if ((ctl_sock = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
err(1, "socket");
- bzero(&sun, sizeof(sun));
+ memset(&sun, 0, sizeof(sun));
sun.sun_family = AF_UNIX;
strlcpy(sun.sun_path, SMTPD_SOCKET, sizeof(sun.sun_path));
if (connect(ctl_sock, (struct sockaddr *)&sun, sizeof(sun)) == -1) {
struct stat_digest last, digest;
size_t count;
- bzero(&last, sizeof(last));
+ memset(&last, 0, sizeof(last));
count = 0;
while (1) {
struct stat_kv kv;
time_t duration;
- bzero(&kv, sizeof kv);
+ memset(&kv, 0, sizeof kv);
while (1) {
srv_send(IMSG_STATS_GET, &kv, sizeof kv);
-/* $OpenBSD: smtpd.c,v 1.207 2013/11/28 12:50:40 eric Exp $ */
+/* $OpenBSD: smtpd.c,v 1.208 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
config_done();
evtimer_set(&config_ev, parent_send_config, NULL);
- bzero(&tv, sizeof(tv));
+ memset(&tv, 0, sizeof(tv));
evtimer_add(&config_ev, &tv);
/* defer offline scanning for a second */
size_t len;
arglist args;
- bzero(&args, sizeof(args));
+ memset(&args, 0, sizeof(args));
if (lstat(path, &sb) == -1) {
log_warn("warn: smtpd: lstat: %s", path);
-/* $OpenBSD: ssl.c,v 1.57 2013/11/28 12:50:40 eric Exp $ */
+/* $OpenBSD: ssl.c,v 1.58 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
{
size_t len;
if (u == NULL) {
- bzero(buf, size);
+ memset(buf, 0, size);
return (0);
}
if ((len = strlcpy(buf, u, size)) >= (size_t)size)
ret = len;
end:
if (len)
- bzero(pass, len);
+ memset(pass, 0, len);
return ret;
}
-/* $OpenBSD: table.c,v 1.12 2013/11/28 10:57:29 eric Exp $ */
+/* $OpenBSD: table.c,v 1.13 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
struct in6_addr mask;
int i;
- bzero(&mask, sizeof(mask));
+ memset(&mask, 0, sizeof(mask));
for (i = 0; i < ssmask->bits / 8; i++)
mask.s6_addr[i] = 0xff;
i = ssmask->bits % 8;
-/* $OpenBSD: table_ldap.c,v 1.7 2013/11/28 10:43:37 eric Exp $ */
+/* $OpenBSD: table_ldap.c,v 1.8 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
return (NULL);
}
- bzero(&hints, sizeof(hints));
+ memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM; /* DUMMY */
error = getaddrinfo(lu.host, NULL, &hints, &res0);
return (-1);
}
- bzero(res, sizeof(res));
+ memset(res, 0, sizeof(res));
ret = ldap_query(filter, q->attrs, res, q->attrn);
if (ret <= 0 || dst == NULL)
goto end;
-/* $OpenBSD: table_sqlite.c,v 1.10 2013/11/28 10:43:37 eric Exp $ */
+/* $OpenBSD: table_sqlite.c,v 1.11 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2013 Eric Faurot <eric@openbsd.org>
dbpath = NULL;
_db = NULL;
- bzero(queries, sizeof(queries));
- bzero(_statements, sizeof(_statements));
+ memset(queries, 0, sizeof(queries));
+ memset(_statements, 0, sizeof(_statements));
_query_fetch_source = NULL;
_stmt_fetch_source = NULL;
-/* $OpenBSD: to.c,v 1.13 2013/11/28 10:43:37 eric Exp $ */
+/* $OpenBSD: to.c,v 1.14 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2009 Jacek Masiulaniec <jacekm@dobremiasto.net>
struct sockaddr_in6 sa_in6;
uint16_t tmp16;
- bzero(&sa_in6, sizeof(sa_in6));
+ memset(&sa_in6, 0, sizeof(sa_in6));
sa_in6.sin6_len = sizeof(sa_in6);
sa_in6.sin6_family = AF_INET6;
memcpy(&sa_in6.sin6_addr, addr, sizeof(sa_in6.sin6_addr));
if (strlcpy(buffer, email, sizeof buffer) >= sizeof buffer)
return 0;
- bzero(maddr, sizeof *maddr);
+ memset(maddr, 0, sizeof *maddr);
username = buffer;
hostname = strrchr(username, '@');
struct sockaddr_in6 ssin6;
int bits;
- bzero(&ssin, sizeof(struct sockaddr_in));
- bzero(&ssin6, sizeof(struct sockaddr_in6));
+ memset(&ssin, 0, sizeof(struct sockaddr_in));
+ memset(&ssin6, 0, sizeof(struct sockaddr_in6));
if (strncasecmp("IPv6:", s, 5) == 0)
s += 5;
size_t i;
int len;
- bzero(buffer, sizeof buffer);
+ memset(buffer, 0, sizeof buffer);
if (strlcpy(buffer, s, sizeof buffer) >= sizeof buffer)
return 0;
static char buf[4096];
char port[4096];
- bzero(buf, sizeof buf);
+ memset(buf, 0, sizeof buf);
switch (relay->flags) {
case F_SMTPS|F_STARTTLS|F_AUTH:
strlcat(buf, "secure+auth://", sizeof buf);
{
static char buf[4096];
- bzero(buf, sizeof buf);
+ memset(buf, 0, sizeof buf);
strlcpy(buf, r->r_decision == R_ACCEPT ? "accept" : "reject", sizeof buf);
if (r->r_tag[0]) {
strlcat(buf, " tagged ", sizeof buf);
char *p;
const char *errstr;
- bzero(buf, sizeof buf);
+ memset(buf, 0, sizeof buf);
p = buf;
while (*s && *s != ':')
*p++ = *s++;
sizeof userinfo->username) >= sizeof userinfo->username)
goto error;
- bzero(buf, sizeof buf);
+ memset(buf, 0, sizeof buf);
p = buf;
while (*s && *s != ':')
*p++ = *s++;
if (errstr)
goto error;
- bzero(buf, sizeof buf);
+ memset(buf, 0, sizeof buf);
p = buf;
while (*s && *s != ':')
*p++ = *s++;
offset = p - s;
- bzero(buffer, sizeof buffer);
+ memset(buffer, 0, sizeof buffer);
if (strlcpy(buffer, s, sizeof buffer) >= sizeof buffer)
return 0;
p = buffer + offset;
static int
alias_is_username(struct expandnode *alias, const char *line, size_t len)
{
- bzero(alias, sizeof *alias);
+ memset(alias, 0, sizeof *alias);
if (strlcpy(alias->u.user, line,
sizeof(alias->u.user)) >= sizeof(alias->u.user))
{
char *domain;
- bzero(alias, sizeof *alias);
+ memset(alias, 0, sizeof *alias);
if (len < 3) /* x@y */
return 0;
static int
alias_is_filename(struct expandnode *alias, const char *line, size_t len)
{
- bzero(alias, sizeof *alias);
+ memset(alias, 0, sizeof *alias);
if (*line != '/')
return 0;
{
size_t skip;
- bzero(alias, sizeof *alias);
+ memset(alias, 0, sizeof *alias);
if (strncasecmp(":include:", line, 9) == 0)
skip = 9;
{
size_t skip;
- bzero(alias, sizeof *alias);
+ memset(alias, 0, sizeof *alias);
if (strncasecmp(":error:", line, 7) == 0)
skip = 7;
-/* $OpenBSD: util.c,v 1.103 2013/11/28 10:43:37 eric Exp $ */
+/* $OpenBSD: util.c,v 1.104 2013/12/26 17:25:32 eric Exp $ */
/*
* Copyright (c) 2000,2001 Markus Friedl. All rights reserved.
if (strlen(path) >= sizeof buf)
return 0;
- bzero(buf, sizeof buf);
+ memset(buf, 0, sizeof buf);
for (p = path; *p; p++) {
if (*p == '/') {
if (buf[0] != '\0')
{
struct linger lng;
- bzero(&lng, sizeof(lng));
+ memset(&lng, 0, sizeof(lng));
if (setsockopt(fd, SOL_SOCKET, SO_LINGER, &lng, sizeof(lng)) == -1)
fatal("session_socket_no_linger");
}