Use memset(3) instead of bzero(3).
Obtained from: OpenBSD (r1.12, r1.20, r1.18 and r1.37)
This commit is contained in:
parent
5902259135
commit
bbdfc8f1ea
@ -363,7 +363,7 @@ ldapclient(int pipe_main2client[2])
|
||||
return (pid);
|
||||
}
|
||||
|
||||
bzero(&env, sizeof(env));
|
||||
memset(&env, 0, sizeof(env));
|
||||
TAILQ_INIT(&env.sc_idms);
|
||||
|
||||
if ((pw = getpwnam(YPLDAP_USER)) == NULL)
|
||||
@ -437,7 +437,7 @@ client_build_req(struct idm *idm, struct idm_req *ir, struct aldap_message *m,
|
||||
char **ldap_attrs;
|
||||
int i, k;
|
||||
|
||||
bzero(ir, sizeof(*ir));
|
||||
memset(ir, 0, sizeof(*ir));
|
||||
for (i = min_attr; i < max_attr; i++) {
|
||||
if (idm->idm_flags & F_FIXED_ATTR(i)) {
|
||||
if (strlcat(ir->ir_line, idm->idm_attrs[i],
|
||||
@ -594,7 +594,7 @@ client_try_idm(struct env *env, struct idm *idm)
|
||||
aldap_freemsg(m);
|
||||
}
|
||||
|
||||
bzero(attrs, sizeof(attrs));
|
||||
memset(attrs, 0, sizeof(attrs));
|
||||
for (i = 0, j = 0; i < ATTR_MAX; i++) {
|
||||
if (idm->idm_flags & F_FIXED_ATTR(i))
|
||||
continue;
|
||||
@ -611,7 +611,7 @@ client_try_idm(struct env *env, struct idm *idm)
|
||||
idm->idm_filters[FILTER_USER], 0, ATTR_MAX, IMSG_PW_ENTRY) == -1)
|
||||
goto bad;
|
||||
|
||||
bzero(attrs, sizeof(attrs));
|
||||
memset(attrs, 0, sizeof(attrs));
|
||||
for (i = ATTR_GR_MIN, j = 0; i < ATTR_GR_MAX; i++) {
|
||||
if (idm->idm_flags & F_FIXED_ATTR(i))
|
||||
continue;
|
||||
|
@ -342,7 +342,7 @@ ypproc_match_2_svc(ypreq_key *arg, struct svc_req *req)
|
||||
log_debug("argument too long");
|
||||
return (NULL);
|
||||
}
|
||||
bzero(key, sizeof(key));
|
||||
memset(key, 0, sizeof(key));
|
||||
(void)strncpy(key, arg->key.keydat_val, arg->key.keydat_len);
|
||||
|
||||
if (strcmp(arg->map, "passwd.byname") == 0 ||
|
||||
@ -486,7 +486,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct svc_req *req)
|
||||
|
||||
if (strcmp(arg->map, "passwd.byname") == 0 ||
|
||||
strcmp(arg->map, "master.passwd.byname") == 0) {
|
||||
bzero(key, sizeof(key));
|
||||
memset(key, 0, sizeof(key));
|
||||
(void)strncpy(key, arg->key.keydat_val,
|
||||
arg->key.keydat_len);
|
||||
ukey.ue_line = key;
|
||||
@ -517,7 +517,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct svc_req *req)
|
||||
|
||||
|
||||
} else if (strcmp(arg->map, "group.byname") == 0) {
|
||||
bzero(key, sizeof(key));
|
||||
memset(key, 0, sizeof(key));
|
||||
(void)strncpy(key, arg->key.keydat_val,
|
||||
arg->key.keydat_len);
|
||||
|
||||
@ -567,7 +567,7 @@ ypproc_master_2_svc(ypreq_nokey *arg, struct svc_req *req)
|
||||
static struct ypresp_master res;
|
||||
static char master[YPMAXPEER + 1];
|
||||
|
||||
bzero(&res, sizeof(res));
|
||||
memset(&res, 0, sizeof(res));
|
||||
if (yp_valid_domain(arg->domain, (struct ypresp_val *)&res) == -1)
|
||||
return (&res);
|
||||
|
||||
@ -620,7 +620,7 @@ yp_make_val(struct ypresp_val *res, char *line, int replacecolon)
|
||||
{
|
||||
static char buf[LINE_WIDTH];
|
||||
|
||||
bzero(buf, sizeof(buf));
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
if (replacecolon)
|
||||
line[strlen(line)] = ':';
|
||||
@ -640,8 +640,8 @@ yp_make_keyval(struct ypresp_key_val *res, char *key, char *line)
|
||||
static char keybuf[YPMAXRECORD+1];
|
||||
static char buf[LINE_WIDTH];
|
||||
|
||||
bzero(keybuf, sizeof(keybuf));
|
||||
bzero(buf, sizeof(buf));
|
||||
memset(keybuf, 0, sizeof(keybuf));
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
(void)strlcpy(keybuf, key, sizeof(keybuf));
|
||||
res->key.keydat_len = strlen(keybuf);
|
||||
|
@ -609,7 +609,7 @@ main(int argc, char *argv[])
|
||||
#warning disabling privilege revocation in debug mode
|
||||
#endif
|
||||
|
||||
bzero(&tv, sizeof(tv));
|
||||
memset(&tv, 0, sizeof(tv));
|
||||
evtimer_set(&ev_timer, main_init_timer, &env);
|
||||
evtimer_add(&ev_timer, &tv);
|
||||
|
||||
|
@ -212,7 +212,7 @@ host_dns(const char *s, struct ypldap_addr_list *hn)
|
||||
struct sockaddr_in6 *sa_in6;
|
||||
struct ypldap_addr *h;
|
||||
|
||||
bzero(&hints, sizeof(hints));
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = PF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_DGRAM; /* DUMMY */
|
||||
error = getaddrinfo(s, NULL, &hints, &res0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user