diff options
author | Christopher Faylor <me@cgf.cx> | 2003-01-26 06:02:34 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-01-26 06:02:34 +0000 |
commit | bdbd7fb6b9c446616197f9da32071f52d3bbd96f (patch) | |
tree | 672fc21f7d3a12e81b14cdebb3059a332e6bc0b4 | |
parent | c9133395631fb7ff2fb37df4a7ac848d1ddf19a0 (diff) | |
download | cygnal-bdbd7fb6b9c446616197f9da32071f52d3bbd96f.tar.gz cygnal-bdbd7fb6b9c446616197f9da32071f52d3bbd96f.tar.bz2 cygnal-bdbd7fb6b9c446616197f9da32071f52d3bbd96f.zip |
* passwd.cc (pwdgrp::parse_passwd): Eliminate use of memset. The structure
should always be completely filled out.
* grp.cc (pwdgrp::parse_group): Ditto.
* grp.cc (pwdgrp::parse_group): Fix off-by-one problem in allocating
-rw-r--r-- | winsup/cygwin/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/cygwin/grp.cc | 7 | ||||
-rw-r--r-- | winsup/cygwin/passwd.cc | 3 |
3 files changed, 8 insertions, 10 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3baf1b05e..629a04bc5 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,6 +1,12 @@ 2003-01-26 Christopher Faylor <cgf@redhat.com> - * pwdgrp.cc (pwdgrp::parse_group): Fix off-by-one problem in allocating + * passwd.cc (pwdgrp::parse_passwd): Eliminate use of memset. The + structure should always be completely filled out. + * grp.cc (pwdgrp::parse_group): Ditto. + +2003-01-26 Christopher Faylor <cgf@redhat.com> + + * grp.cc (pwdgrp::parse_group): Fix off-by-one problem in allocating gr_mem. 2003-01-26 Christopher Faylor <cgf@redhat.com> diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc index 7d7f373a2..dc93f913c 100644 --- a/winsup/cygwin/grp.cc +++ b/winsup/cygwin/grp.cc @@ -36,12 +36,7 @@ static char * NO_COPY null_ptr; bool pwdgrp::parse_group () { - char *dp; - # define grp (*group_buf)[curr_lines] - - memset (&grp, 0, sizeof (grp)); - grp.gr_name = next_str (); if (!*grp.gr_name) return false; @@ -52,7 +47,7 @@ pwdgrp::parse_group () return false; int n; - dp = raw_ptr (); + char *dp = raw_ptr (); for (n = 0; *next_str (','); n++) continue; diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc index fe21299b2..113f92acf 100644 --- a/winsup/cygwin/passwd.cc +++ b/winsup/cygwin/passwd.cc @@ -38,9 +38,6 @@ bool pwdgrp::parse_passwd () { # define res (*passwd_buf)[curr_lines] - - memset (&res, 0, sizeof (res)); - res.pw_name = next_str (); res.pw_passwd = next_str (); |