Re: CVS: cvs.openbsd.org: src

2016-06-28 Thread Michael McConville
Ted Unangst wrote:
> Philip Guenther wrote:
> > Yes, two _MALLOC_LEAVE calls can occur without a _MALLOC_ENTRY between them.
> > 
> >   T1 -> MALLOC_LOCK, do stuff
> >   T2 -> block in MALLOC_LOCK
> >   T1 -> MALLOC_LEAVE, MMAP()
> > unmap_me is still set, but to an already unmaped region
> >   T2 -> return from MALLOC_LOCK, do stuff
> >   T1 -> block in MALLOC_ENTRY
> >   T2 -> MALLOC_LEAVE
> >this unmaps the same unmap_me from above, which may have
> > already been mapped by some other thread
> > 
> > MALLOC_LEAVE must clear unmap_me after copying the value into local
> > variables and before releasing the lock, MALLOC_ENTRY shouldn't touch
> > them at all.
> 
> AH! the light goes on. I incorrectly thought MALLOC ENTER/LEAVE were the
> functions called everywhere. having a separate set of LOCK/UNLOCK calls
> elsewhere is trouble.
> 
> This could be reworked to consistently use ENTER/LEAVE, but not today.

I made the same mistake.

Thanks to everyone who adopted and debugged this.



CVS: cvs.openbsd.org: src

2016-03-26 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/26 18:55:38

Modified files:
lib/libssl/src/ssl: s3_clnt.c 

Log message:
Merge a memleak fix from BoringSSL 6b6e0b2:

https://boringssl.googlesource.com/boringssl/+/6b6e0b20893e2be0e68af605a60ffa2cbb0ffa64%5E!/#F0

ok millert@, beck@



CVS: cvs.openbsd.org: src

2016-03-26 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/26 18:43:38

Modified files:
bin/ed : ed.h 

Log message:
actually remove unnecessary includes

from Edgar Pettijohn, ok and with input from tb@



CVS: cvs.openbsd.org: src

2016-03-25 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/25 19:24:08

Removed files:
lib/libc/quad/TESTS: Makefile divrem.c mul.c 

Log message:
remove some unused ancient test files from 4.4 BSD

ok guenther@, millert@, deraadt@



CVS: cvs.openbsd.org: src

2016-03-23 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/23 08:52:42

Modified files:
bin/stty   : cchar.c gfmt.c key.c modes.c print.c stty.c 
 stty.h 

Log message:
header cleanup

from Edgar Pettijohn, with a correction from deraadt@



CVS: cvs.openbsd.org: src

2016-03-22 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/22 12:24:35

Modified files:
usr.bin/yacc   : reader.c 

Log message:
merge three obviously redundant adjacent if statements

from Michael W. Bombardieri



CVS: cvs.openbsd.org: src

2016-03-22 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/22 11:58:28

Modified files:
bin/ed : buf.c glbl.c io.c main.c re.c sub.c undo.c 

Log message:
header cleanup

from Edgar Pettijohn, correction from deraadt@



CVS: cvs.openbsd.org: src

2016-03-20 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/20 22:05:33

Modified files:
lib/libssl/src/crypto/x509: x509_att.c x509_v3.c 

Log message:
Return zero from two functions on allocation failure instead of always
returning one (indicating success). Each function has only a single
usage, and both usages check the return value.

Merged from BoringSSL 0ce78a757d815c0dde9ed5884229f3a5b2cb3e9c:

https://boringssl.googlesource.com/boringssl/+/0ce78a757d815c0dde9ed5884229f3a5b2cb3e9c%5E!/#F0

ok beck@



CVS: cvs.openbsd.org: www

2016-03-20 Thread Michael McConville
CVSROOT:/cvs
Module name:www
Changes by: m...@cvs.openbsd.org2016/03/20 12:09:40

Modified files:
.  : anoncvs.html 
build  : mirrors.dat 

Log message:
typo fix: openbsdacvs.cs.toronto.edu -> obsdacvs.cs.toronto.edu

confirmed by the maintainer, Nick Holland



CVS: cvs.openbsd.org: src

2016-03-19 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/17 12:50:48

Modified files:
usr.sbin/edquota: edquota.8 
usr.sbin/repquota: repquota.8 

Log message:
Remove needless DIAGNOSTICS sections saying only "Various messages about
inaccessible files; self-explanatory."

ok jmc@



Re: CVS: cvs.openbsd.org: src

2016-03-19 Thread Michael McConville
Michael McConville wrote:
> CVSROOT:  /cvs
> Module name:  src
> Changes by:   m...@cvs.openbsd.org2016/03/17 11:55:33
> 
> Modified files:
>   lib/libc/stdlib: malloc.c 
> 
> Log message:
> properly guard to macros
> 
> ok otto@

s/ to / two /



CVS: cvs.openbsd.org: src

2016-03-19 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/16 09:36:26

Modified files:
usr.bin/less   : ch.c charset.c cmdbuf.c command.c cvt.c 
 decode.c edit.c filename.c lesskey.c line.c 
 lsystem.c main.c os.c screen.c search.c 
 signal.c 

Log message:
style(9) includes

ok nicm@



CVS: cvs.openbsd.org: src

2016-03-19 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/17 17:33:23

Modified files:
bin/ksh: edit.c jobs.c trap.c 

Log message:
remove some ARGSUSED



CVS: cvs.openbsd.org: src

2016-03-18 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/17 17:48:42

Modified files:
lib/libc/gen   : fstab.c 

Log message:
remove NOTREACHED



CVS: cvs.openbsd.org: src

2016-03-18 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/17 11:55:33

Modified files:
lib/libc/stdlib: malloc.c 

Log message:
properly guard to macros

ok otto@



CVS: cvs.openbsd.org: src

2016-03-15 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/15 22:33:01

Modified files:
usr.bin/less   : ch.c 

Log message:
Wrap a macro's args in parentheses. No binary change.

I'm discussing with deraadt@ whether it's a good idea to convert some of
these to functions. The one changed by this commit probably isn't
eligible because it defines only a for loop's condition, but many others
in less(1) should probably be converted.

ok millert@



CVS: cvs.openbsd.org: src

2016-03-14 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/14 23:03:11

Modified files:
usr.sbin/tcpdump: print-icmp6.c print-snmp.c 

Log message:
o remove legacy code that defines abs(3) if it isn't available

o inline an ugly and potentially risky macro of the form:

#define x if (a) b; else

o fix a >21 y.o. bug resulting from someone writing:

puts("[nothing to parse], stdout");

when they meant:

fputs("[nothing to parse]", stdout);

ok canacar@



CVS: cvs.openbsd.org: src

2016-03-14 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/14 22:19:13

Modified files:
usr.bin/hexdump: display.c hexdump.h hexsyntax.c odsyntax.c 
 parse.c 

Log message:
o clean up a little whitespace and formatting
o move some declarations out of hexdump.h
o mark some declarations as __dead or static

from Michal Mazurek, with input from and ok tb@



CVS: cvs.openbsd.org: src

2016-03-14 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/14 19:00:17

Modified files:
usr.bin/unifdef: unifdef.c 

Log message:
Replace two malloc casts that deraadt@ and I removed over the past year
or two. Upstream wants to keep them for C++ support, and it isn't worth
maintaining a larger diff. No binary change.

Upstream commit:

https://github.com/fanf2/unifdef/commit/87dfd91

I'll send more merging diffs to tech@ soon.



CVS: cvs.openbsd.org: src

2016-03-14 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/14 08:48:02

Modified files:
lib/libc/gmon  : gmon.c 

Log message:
(char *)0 -> NULL



Re: CVS: cvs.openbsd.org: src

2016-03-14 Thread Michael McConville
Michael McConville wrote:
> CVSROOT:  /cvs
> Module name:  src
> Changes by:   m...@cvs.openbsd.org2016/03/12 14:31:23
> 
> Modified files:
>   lib/libc/stdlib: hcreate.3 malloc.3 qsort.3 tsearch.3 
>   lib/libcrypto/man: ASN1_OBJECT_new.3 BUF_MEM_new.3 
>   lib/libssl/src/doc/crypto: DH_new.pod DH_set_method.pod 
>  DSA_SIG_new.pod DSA_new.pod 
>  DSA_set_method.pod 
>  ERR_load_strings.pod RAND_cleanup.pod 
>  RSA_blinding_on.pod RSA_new.pod 
>  RSA_set_method.pod X509_new.pod 
> 
> Log message:
> Remove sentences in RETURN VALUES sections saying that functions with
> void return types 'return no value'. This is obvious and therefore
> unneccessary to mention.
> 
> We spare rewind(3)'s sentence because espie@ pointed out that it's a
> warning - the function masks a potential error.
> 
> This commit also adds a sentence to X509_free clarifying that it's
> NULL-safe. This bit was discussed with doug@.
> 
> ok martijn@, sentiment supported by schwarze@

was also ok jmc@



CVS: cvs.openbsd.org: src

2016-03-14 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/14 08:44:03

Modified files:
bin/df : df.c 

Log message:
replace __progname with getprogname(3)

from Michal Mazurek, ok tb@



CVS: cvs.openbsd.org: src

2016-03-13 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/13 21:01:48

Modified files:
share/man/man1 : gcc-local.1 

Log message:
Remove a reference to lint(1) in the description of the -CC option. The
option itself may go away sometime soon.

ok guenther@, deraadt@



CVS: cvs.openbsd.org: src

2016-03-12 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/12 14:31:23

Modified files:
lib/libc/stdlib: hcreate.3 malloc.3 qsort.3 tsearch.3 
lib/libcrypto/man: ASN1_OBJECT_new.3 BUF_MEM_new.3 
lib/libssl/src/doc/crypto: DH_new.pod DH_set_method.pod 
   DSA_SIG_new.pod DSA_new.pod 
   DSA_set_method.pod 
   ERR_load_strings.pod RAND_cleanup.pod 
   RSA_blinding_on.pod RSA_new.pod 
   RSA_set_method.pod X509_new.pod 

Log message:
Remove sentences in RETURN VALUES sections saying that functions with
void return types 'return no value'. This is obvious and therefore
unneccessary to mention.

We spare rewind(3)'s sentence because espie@ pointed out that it's a
warning - the function masks a potential error.

This commit also adds a sentence to X509_free clarifying that it's
NULL-safe. This bit was discussed with doug@.

ok martijn@, sentiment supported by schwarze@



CVS: cvs.openbsd.org: src

2016-03-11 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/11 11:41:33

Modified files:
sys/dev/usb: uoakrh.c 

Log message:
don't check a stack-allocated array against NULL

ok mpi@



CVS: cvs.openbsd.org: src

2016-03-10 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/11 00:08:45

Modified files:
lib/libssl/src/crypto/asn1: x_info.c 
lib/libssl/src/crypto/cms: cms_asn1.c cms_sd.c 
lib/libssl/src/crypto/pkcs12: p12_kiss.c 
lib/libssl/src/crypto/ts: ts_rsp_sign.c 
lib/libssl/src/crypto/x509: by_file.c x509_vfy.c 
lib/libssl/src/crypto/x509v3: pcy_tree.c 
lib/libssl/src/ssl: d1_clnt.c s3_clnt.c s3_srvr.c ssl_asn1.c 
ssl_cert.c ssl_rsa.c ssl_sess.c 

Log message:
X509_free(3) is NULL-safe, so remove NULL checks before its calls.

ok doug@



CVS: cvs.openbsd.org: src

2016-03-10 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/10 16:21:46

Modified files:
lib/libssl/src/crypto/ec: ec_curve.c 
lib/libssl/src/doc/ssl: SSL_CTX_set_max_cert_list.3 
lib/libssl/src/ssl: t1_lib.c 

Log message:
http -> https for a few more IETF URLs in comments or man pages



CVS: cvs.openbsd.org: src

2016-03-10 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/10 16:18:56

Modified files:
sys/dev/ic : ti.c 

Log message:
don't check stack-allocated arrays against NULL

ok mpi@



CVS: cvs.openbsd.org: src

2016-03-10 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/10 11:30:53

Modified files:
lib/libc/gen   : login_cap.c 

Log message:
ANSIfy function declarations, move initializations to declaration block

ok millert@



CVS: cvs.openbsd.org: src

2016-03-07 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/07 12:33:26

Modified files:
lib/libssl/src/ssl: tls1.h 
sbin/iked  : pfkey.c 
sys/net: if_types.h 
sys/netinet: ip_icmp.h 
usr.sbin/snmpd : mib.h 
usr.sbin/tcpdump: ike.h print-domain.c 

Log message:
http -> https for IETF/IANA URLs in comments



CVS: cvs.openbsd.org: src

2016-03-06 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/06 18:19:47

Modified files:
bin/df : df.c 

Log message:
simplify print formatting logic, replace exit() in main() with return

from Michal Mazurek, ok tb@



CVS: cvs.openbsd.org: src

2016-03-06 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/06 17:16:35

Modified files:
usr.sbin/mtrace: mtrace.c 

Log message:
(type *)0 -> NULL

ok sha256@



CVS: cvs.openbsd.org: src

2016-03-06 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/06 17:11:11

Modified files:
sys/arch/sparc/dev: qec.c 

Log message:
remove needless malloc cast



CVS: cvs.openbsd.org: src

2016-03-01 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/01 12:17:38

Modified files:
sys/arch/mips64/include: cpu.h 
sys/arch/alpha/include: cpu.h 

Log message:
guard macro args with parens

from Michal Mazurek, ok deraadt@



CVS: cvs.openbsd.org: src

2016-03-01 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/01 11:00:42

Modified files:
bin/df : df.c 

Log message:
tidy up function declarations and definitions

from Michal Mazurek, ok tb@



CVS: cvs.openbsd.org: src

2016-03-01 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/03/01 10:57:49

Modified files:
bin/df : ext2fs_df.c ffs_df.c 

Log message:
remove unneeded includes

from Michal Mazurek, ok tb@



CVS: cvs.openbsd.org: src

2016-02-28 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/28 23:48:03

Modified files:
lib/libssl/src/ssl: d1_lib.c 

Log message:
remove NULL checks for pqueue_free()

ok doug@



CVS: cvs.openbsd.org: src

2016-02-27 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/27 15:01:58

Modified files:
sys/dev/pckbc  : pms.c 

Log message:
pakets -> packets



CVS: cvs.openbsd.org: src

2016-02-27 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/27 14:58:48

Modified files:
sys/arch/hppa64/hppa64: intr.c 

Log message:
Remove a couple malloc casts. No functional change.



CVS: cvs.openbsd.org: src

2016-02-25 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/25 19:07:03

Modified files:
sys/arch/sh/sh : clock.c 
sys/arch/alpha/alpha: clock.c 

Log message:
Make alpha and sh 2038-safe. Now that we have 64-bit time_t, we don't
need to ignore the hardware clock when it reports a year > 2037. Irony
noted.

both ok millert, alpha ok deraadt



CVS: cvs.openbsd.org: src

2016-02-12 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/12 13:02:04

Modified files:
sys/dev/ic : smc91cxx.c 

Log message:
pcakets -> packets



CVS: cvs.openbsd.org: src

2016-02-11 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/11 17:10:59

Modified files:
usr.sbin/tokeninit: tokeninit.c 

Log message:
hexidecimal -> hexadecimal



CVS: cvs.openbsd.org: src

2016-02-08 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/08 19:13:12

Modified files:
usr.bin/hexdump: parse.c 

Log message:
Replace a three step string duplication with strndup().

ok and with input from tb@



CVS: cvs.openbsd.org: src

2016-02-08 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/08 17:56:04

Modified files:
sys/nfs: nfs_node.c 

Log message:
sync a function's comment with its signature

ok tedu@, with a slight tweak



CVS: cvs.openbsd.org: src

2016-02-08 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/08 14:05:51

Modified files:
usr.bin/hexdump: hexdump.c 

Log message:
remove main() declaration

from Michal Mazurek



CVS: cvs.openbsd.org: src

2016-02-08 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/08 09:23:54

Modified files:
bin/df : df.c ext2fs_df.c ffs_df.c 

Log message:
remove needless headers

ok tb@, from Michal Mazurek



CVS: cvs.openbsd.org: src

2016-02-07 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/07 13:50:24

Modified files:
lib/libc/stdlib: strtonum.3 

Log message:
compare pointer to NULL in example code



Re: CVS: cvs.openbsd.org: src

2016-02-07 Thread Michael McConville
Michael McConville wrote:
> CVSROOT:  /cvs
> Module name:  src
> Changes by:   m...@cvs.openbsd.org2016/02/07 13:11:54
> 
> src/lib/libc/ubsan
> 
> Update of /cvs/src/lib/libc/ubsan
> In directory cvs.openbsd.org:/tmp/cvs-serv20465/ubsan
> 
> Log Message:
> Directory /cvs/src/lib/libc/ubsan added to the repository

Sorry everyone, this was meant to be local. How should I remove it?



CVS: cvs.openbsd.org: src

2016-02-07 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/07 13:11:54

src/lib/libc/ubsan

Update of /cvs/src/lib/libc/ubsan
In directory cvs.openbsd.org:/tmp/cvs-serv20465/ubsan

Log Message:
Directory /cvs/src/lib/libc/ubsan added to the repository



CVS: cvs.openbsd.org: src

2016-02-03 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/03 08:47:27

Modified files:
usr.bin/less   : optfunc.c 

Log message:
Rename a local var so that we can call the global message buffer msg.

ok nicm, tb



CVS: cvs.openbsd.org: src

2016-02-02 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/02/02 18:47:25

Modified files:
usr.bin/vi/cl  : cl_main.c 
usr.bin/vi/common: main.c mem.h 

Log message:
Remove needless alias macros for malloc and calloc. No binary change. I
got this upstreamed a few weeks ago.

ok tb (less a few style tweaks), martijn (who suggested style tweaks)



CVS: cvs.openbsd.org: src

2016-01-29 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/29 09:13:17

Modified files:
usr.bin/less   : less.h 

Log message:
sort includes

from Michael Reed



CVS: cvs.openbsd.org: src

2016-01-29 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/29 09:10:48

Modified files:
usr.bin/less   : less.h 

Log message:
remove unneeded CHAR_BIT macro

from Michael Reed



CVS: cvs.openbsd.org: src

2016-01-28 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/28 21:51:26

Modified files:
usr.bin/less   : defines.h filename.c 

Log message:
remove superfluous macro

ok nicm



CVS: cvs.openbsd.org: src

2016-01-28 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/28 19:22:57

Modified files:
usr.sbin/ifstated: parse.y 

Log message:
Fix err.h uses, reporting errno when available and simplifying error
messages.

Partially from Michael Reed.



CVS: cvs.openbsd.org: src

2016-01-26 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/26 12:09:57

Modified files:
sbin/newfs_ext2fs: mke2fs.c 

Log message:
Remove needless zeroing. Anonymously mapped memory is always zeroed.

ok tb@



CVS: cvs.openbsd.org: src

2016-01-26 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/26 11:35:01

Modified files:
usr.bin/telnet : telnet.c 
usr.sbin/bgpd  : config.c 

Log message:
typos



Re: CVS: cvs.openbsd.org: src

2016-01-26 Thread Michael McConville
Michael McConville wrote:
> Michael McConville wrote:
> > CVSROOT:/cvs
> > Module name:src
> > Changes by: m...@cvs.openbsd.org2016/01/26 11:26:19
> > 
> > Modified files:
> > usr.sbin/rarpd : arptab.c 
> > usr.sbin/arp   : arp.c 
> > usr.sbin/ndp   : ndp.c 
> > sbin/dhclient  : dhclient.c 
> > 
> > Log message:
> > Use an unsigned int rather than an int when iterating through all 32
> > bits in the form:
> > 
> > for (i = 1; i; i <<= 1)
> > 
> > This avoids undefined operations when shifting into and out of the
> > highest-order bit.
> > 
> > ok millert@
> 
> Also with an additional instance spotted by millert@.

and ok otto@



Re: CVS: cvs.openbsd.org: src

2016-01-26 Thread Michael McConville
Michael McConville wrote:
> CVSROOT:  /cvs
> Module name:  src
> Changes by:   m...@cvs.openbsd.org2016/01/26 11:26:19
> 
> Modified files:
>   usr.sbin/rarpd : arptab.c 
>   usr.sbin/arp   : arp.c 
>   usr.sbin/ndp   : ndp.c 
>   sbin/dhclient  : dhclient.c 
> 
> Log message:
> Use an unsigned int rather than an int when iterating through all 32
> bits in the form:
> 
> for (i = 1; i; i <<= 1)
> 
> This avoids undefined operations when shifting into and out of the
> highest-order bit.
> 
> ok millert@

Also with an additional instance spotted by millert@.



CVS: cvs.openbsd.org: src

2016-01-26 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/26 11:26:19

Modified files:
usr.sbin/rarpd : arptab.c 
usr.sbin/arp   : arp.c 
usr.sbin/ndp   : ndp.c 
sbin/dhclient  : dhclient.c 

Log message:
Use an unsigned int rather than an int when iterating through all 32
bits in the form:

for (i = 1; i; i <<= 1)

This avoids undefined operations when shifting into and out of the
highest-order bit.

ok millert@



CVS: cvs.openbsd.org: src

2016-01-26 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/26 10:39:31

Modified files:
bin/ksh: edit.h emacs.c 

Log message:
remove a useless macro

ok nicm@



CVS: cvs.openbsd.org: src

2016-01-25 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/25 18:51:06

Modified files:
usr.bin/less   : less.h line.c output.c prompt.c 

Log message:
Remove a fancy macro that calculates the necessary buffer size for
int-to-str conversions and just use constants instead. The only binary
change is caused by using an unnecessarily large buffer for an int. This
is a consequence of simplifying some code that will be gone soon.

ok nicm@



CVS: cvs.openbsd.org: src

2016-01-23 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/23 23:32:33

Modified files:
sbin/mount_vnd : mount_vnd.c 

Log message:
fix 1.18 by removing extra argument from explicit_bzero calls

from kili@



CVS: cvs.openbsd.org: src

2016-01-23 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/23 18:20:44

Modified files:
sbin/mount_vnd : mount_vnd.c 

Log message:
Immediately zero the stack-allocated buffers for the passphrase and salt rather
than doing so conditionally later on. These were false positives during an
explicit_bzero audit.

ok gsoares@



CVS: cvs.openbsd.org: src

2016-01-19 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/19 13:32:29

Modified files:
lib/libc/gmon  : gmon.c 

Log message:
replace (void *)0 with NULL



CVS: cvs.openbsd.org: src

2016-01-19 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/19 11:22:53

Modified files:
lib/libc/stdio : vfprintf.c 

Log message:
remove a nop assignment that has been #if 0'd since 1996

ok millert@



CVS: cvs.openbsd.org: src

2016-01-18 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/18 23:14:54

Modified files:
usr.bin/less   : funcs.h 

Log message:
Remove the lintism PRINTFLIKE1, don't replace it with an attribute so we
can keep it portable.

also noticed by Michael Reed, discussed with deraadt@



CVS: cvs.openbsd.org: src

2016-01-16 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/16 17:59:09

Modified files:
usr.bin/less   : prompt.c 

Log message:
start removing mp, the pointer to message's nul byte

ok deraadt@



Re: CVS: cvs.openbsd.org: www

2016-01-16 Thread Michael McConville
Theo Buehler wrote:
> CVSROOT:  /cvs
> Module name:  www
> Changes by:   t...@cvs.openbsd.org2016/01/16 17:32:34
> 
> Modified files:
>   faq: faq10.html 
> 
> Log message:
> Mention rcctl(8) before explaining how to edit rc.conf.local by hand.
> The former method is easier, safer and should be preferred.
> 
> tweaks and ok tj@

I think I remember a few devs saying that rcctl(8) is what people should
use these days. If that's true, maybe the FAQ can just spend a sentence
or two describing what rc.conf.local is and point to the man page
instead of describing it in detail.



CVS: cvs.openbsd.org: src

2016-01-15 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/15 15:22:38

Modified files:
usr.bin/less   : funcs.h 

Log message:
remove needless extern keywords, a vestige of pre-ANSI C

explained by and ok millert@



CVS: cvs.openbsd.org: src

2016-01-15 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/15 13:49:59

Modified files:
usr.bin/less   : less.h 

Log message:
Use quotes rather than angle brackets for local header. Fixes building
with Clang 3.7.

ok millert@



CVS: cvs.openbsd.org: src

2016-01-15 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/15 11:02:18

Modified files:
usr.sbin/tcpdump: parsenfsfh.c 

Log message:
remove a macro that was made an identity function by my previous commit

ok deraadt@



CVS: cvs.openbsd.org: src

2016-01-15 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/15 10:55:45

Modified files:
bin/ksh: c_ksh.c 

Log message:
Initialize a struct kill_info and an associated int in the declarations
instead of scattering their initialization through the body. This makes
the body simpler and avoids an uninitialized use false positive.

ok nicm@



CVS: cvs.openbsd.org: www

2016-01-14 Thread Michael McConville
CVSROOT:/cvs
Module name:www
Changes by: m...@cvs.openbsd.org2016/01/14 20:20:58

Modified files:
faq: faq10.html 

Log message:
add missing word, from Halim Srama



CVS: cvs.openbsd.org: src

2016-01-14 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/14 20:03:07

Modified files:
usr.sbin/tcpdump: nfsfh.h parsenfsfh.c print-nfs.c 

Log message:
Remove preprocessor conditions (checking for ancient OSs) that try to
divine whether a file handle was generated on the current host. More
simplifications to come.

supported by deraadt@



CVS: cvs.openbsd.org: src

2016-01-14 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/14 19:37:12

Modified files:
sys/net: pf_ruleset.c 

Log message:
rs_malloc() does not need to be cast



CVS: cvs.openbsd.org: src

2016-01-14 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/14 11:56:55

Modified files:
usr.sbin/smtpd : mta.c 

Log message:
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@



CVS: cvs.openbsd.org: www

2016-01-13 Thread Michael McConville
CVSROOT:/cvs
Module name:www
Changes by: m...@cvs.openbsd.org2016/01/13 21:26:42

Modified files:
faq: faq14.html 

Log message:
two minor rewordings (as per XXX, more to come)



CVS: cvs.openbsd.org: src

2016-01-13 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/13 18:53:29

Modified files:
gnu/gcc/gcc/config/mt: mt.c 

Log message:
fix typo

from Jan Schreiber, ok deraadt@



CVS: cvs.openbsd.org: src

2016-01-13 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/13 15:47:45

Modified files:
usr.bin/less   : less.h line.c output.c prompt.c 

Log message:
unify two identical function pairs now that we've removed less's off_t
aliases

ok nicm@



CVS: cvs.openbsd.org: src

2016-01-12 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/12 16:01:23

Modified files:
usr.bin/less   : edit.c main.c optfunc.c prompt.c signal.c 

Log message:
remove lint annotations

ok nicm@



CVS: cvs.openbsd.org: src

2016-01-12 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/12 10:48:05

Modified files:
usr.bin/less   : cmdbuf.c command.c funcs.h jump.c less.h line.c 
 linenum.c output.c prompt.c search.c tags.c 

Log message:
Remove LINUNUM, a needless alias for off_t. Also, remove a redundant
condition.

ok nicm@



CVS: cvs.openbsd.org: src

2016-01-09 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/09 14:27:28

Modified files:
lib/libc/sys   : sync.2 
bin/sync   : sync.8 

Log message:
Replace "function call" with "function" when referring to a function
(well, a syscall, but this is the established practice) in the general
sense.

ok jmc@



CVS: cvs.openbsd.org: src

2016-01-09 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2016/01/09 10:34:43

Modified files:
usr.bin/less   : cvt.c less.h 

Log message:
Remove superfluous and barely used macro aliases for wctype.h functions.

ok nicm@



Re: CVS: cvs.openbsd.org: src

2016-01-04 Thread Michael McConville
Theo Buehler wrote:
> CVSROOT:  /cvs
> Module name:  src
> Changes by:   t...@cvs.openbsd.org2016/01/04 03:59:23
> 
> Modified files:
>   usr.bin/make   : main.c 
> 
> Log message:
> Use err(3) instead of various handrolled combinations of perror(3) and
> fprintf(stderr, ...) with strerror(3) and exit(3).  Make sure the exit
> status is 2 if an error occurred.  Prompted by gsoares@'s and jsg@'s
> audit of exit statuses after failure of pledge(2).
> 
> ok gsoares@

Note that while most err.h functions are in glibc and even musl, they
aren't standardized. Because of this, a few things in base such as
LibreSSL and OpenSSH use perror/exit instead. I don't know whether this
is relevant to make, but I thought it was worth mentioning.



CVS: cvs.openbsd.org: src

2015-12-31 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2015/12/31 11:55:33

Modified files:
sys/kern   : exec_script.c 

Log message:
NULL-terminate a pointer array to prevent an invalid free, and simplify
the associated pointer incrementing logic.

Reported by Maxim Pugachev. Looks good to tedu@



CVS: cvs.openbsd.org: src

2015-12-30 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2015/12/30 10:16:47

Modified files:
usr.bin/yacc   : skeleton.c 

Log message:
Back out of 1.36 and 1.37, which made simplifications to allocation
logic based on C89. It broke a few C++ ports. Prompted by kettenis@



CVS: cvs.openbsd.org: src

2015-12-29 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2015/12/29 15:31:21

Modified files:
lib/libc/gen   : nlist.c 

Log message:
Verify that the section header size supplied in the ELF header is what
we expect it to be. This prevents out-of-bounds access or excessive
memory allocation on a malformed ELF header.

Found by Serguey Parkhomovsky with AFL. Improved by and ok kettenis@



CVS: cvs.openbsd.org: src

2015-12-29 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2015/12/29 11:35:39

Modified files:
sys/dev/mii: mii.c 

Log message:
Tweak previous by de-indenting label and replacing remaining continues
with gotos.

supported by kettenis@, ok sobrado@



CVS: cvs.openbsd.org: src

2015-12-28 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2015/12/28 21:46:28

Modified files:
sys/arch/sparc/sparc: pmap.c 
sys/arch/sparc64/dev: central.c vdsp.c 
sys/dev: firmload.c softraid.c softraid_crypto.c 
sys/dev/acpi   : acpicpu.c 

Log message:
Remove NULL-checks before free().

ok tb@



CVS: cvs.openbsd.org: src

2015-12-28 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2015/12/28 18:02:34

Modified files:
bin/ksh: ksh.1 

Log message:
Remove reference to $ERRNO, which was been unimplemented for >= 19
years.

>From Michael Reed. ok halex@



CVS: cvs.openbsd.org: src

2015-12-28 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2015/12/28 16:30:59

Modified files:
share/man/man5 : bsd.port.mk.5 forward.5 

Log message:
The last of the e-mail -> email.



CVS: cvs.openbsd.org: src

2015-12-28 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2015/12/28 16:01:22

Modified files:
lib/libc/regex : engine.c 

Log message:
Remove NULL-checks before free() and needless argument casts.

ok tb@



CVS: cvs.openbsd.org: src

2015-12-28 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2015/12/28 15:25:41

Modified files:
sys/dev/mii: mii.c 

Log message:
1. Add a loop_end label to the outer loop
2. Replace a continue statement in an inner loop with goto loop_end

This fixes a simple logical bug found with Coccinelle.

ok kettenis@



CVS: cvs.openbsd.org: src

2015-12-28 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2015/12/28 15:27:04

Modified files:
lib/libc/regex : regfree.c 

Log message:
Remove NULL-checks before free() and unnecessary argument casts.

ok tb@



CVS: cvs.openbsd.org: src

2015-12-28 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2015/12/28 15:08:18

Modified files:
lib/libc/db/btree: bt_open.c 
lib/libc/db/hash: hash.c hash_bigkey.c 
lib/libc/gen   : auth_subr.c getpwent.c glob.c login_cap.c 
lib/libc/net   : freeaddrinfo.c 
lib/libc/regex : regcomp.c regfree.c 
lib/libc/rpc   : pmap_rmt.c 
lib/libc/stdio : asprintf.c vasprintf.c vfprintf.c vfwprintf.c 
lib/libc/stdlib: ecvt.c 

Log message:
Remove NULL-checks before free() and a few related dead assignments.

ok and valuable input from millert@



Re: CVS: cvs.openbsd.org: src

2015-12-28 Thread Michael McConville
Michael McConville wrote:
> CVSROOT:  /cvs
> Module name:  src
> Changes by:   m...@cvs.openbsd.org2015/12/28 12:14:04
> 
> Modified files:
>   usr.bin/yacc   : skeleton.c 
> 
> Log message:
> realloc and free's behavior when passed NULL is defined by C89, so we
> can safely assume it.
> 
> ok millert@. Also discussed with deraadt@, sthen@, and espie@.

The realloc part was also explicitly ok deraadt@

To clarify, it is significant that these behaviors are from ancient
standards because some programs using yacc redefine the allocation
functions. Todd pointed out that C89 features are assumed in yacc, so
these should be fine.



CVS: cvs.openbsd.org: src

2015-12-28 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2015/12/28 12:14:04

Modified files:
usr.bin/yacc   : skeleton.c 

Log message:
realloc and free's behavior when passed NULL is defined by C89, so we
can safely assume it.

ok millert@. Also discussed with deraadt@, sthen@, and espie@.



CVS: cvs.openbsd.org: src

2015-12-27 Thread Michael McConville
CVSROOT:/cvs
Module name:src
Changes by: m...@cvs.openbsd.org2015/12/27 10:51:19

Modified files:
usr.bin/less   : ch.c 

Log message:
Put macro arg in parentheses.

ok nicm@



CVS: cvs.openbsd.org: www

2015-12-26 Thread Michael McConville
CVSROOT:/cvs
Module name:www
Changes by: m...@cvs.openbsd.org2015/12/26 13:49:50

Modified files:
faq: faq8.html 

Log message:
the Opera port is gone

ok zhuk@



  1   2   3   4   5   >