[patch sbin/iked/pfkey.c] replacing select with poll

2014-05-06 Thread Peter Malone
== 0) { log_warnx(%s: no reply from PF_KEY, __func__); return (-1); } -- Peter Malone pe...@petermalone.org

[patch usr.bin/pkill/pkill.c malloc memset = calloc

2014-05-06 Thread Peter Malone
= malloc(nproc)) == NULL) + if ((selected = calloc(1, nproc)) == NULL) errx(STATUS_ERROR, memory allocation failure); - memset(selected, 0, nproc); /* * Refine the selection. -- Peter Malone pe...@petermalone.org

Re: [patch src/usr.bin/mg/undo.c] replace malloc memset with calloc

2014-04-24 Thread Peter Malone
On 04/24/14 04:09, Stuart Henderson wrote: On 2014/04/24 04:26, Miod Vallat wrote: Same as the others, this time with src/usr.bin/mg/undo.c You are now losing a memset() in the `rec doesn't come from malloc' code path. From the number and types of diff being sent, I am guessing these are

Re: sudo alloc.c -- cleanup required?

2014-04-24 Thread Peter Malone
Great explanation - thanks. On 04/24/14 08:28, Todd C. Miller wrote: Sudo runs on more systems thsan just OpenBSD and so has a lot of configure goo and defines as a result. There's really no point in removing that. Any changes made to the sudo in OpenBSD just makes updates harder. The

Re: [patch sbin/nfsd/nfsd.c] replace malloc memset with calloc

2014-04-24 Thread Peter Malone
The more I think about this. if we want to continue the select() NULL functionality then timeout should be a negative value for poll(), as NULL is unrecognized and zero is a zero-length timeout. On 04/24/14 18:08, Peter Malone wrote: As promised. I cleaned up some of the code as well

[patch usr.sbin/rtsold/rtsold.c] replace malloc memset with calloc

2014-04-24 Thread Peter Malone
allocation failed); free(sdl); return(-1); } - memset(ifinfo, 0, sizeof(*ifinfo)); ifinfo-sdl = sdl; strncpy(ifinfo-ifname, ifname, sizeof(ifinfo-ifname)); -- Peter Malone pe...@petermalone.org

[patch l2tpd.c] malloc memset = calloc

2014-04-24 Thread Peter Malone
(plistener-bind) = addr-sa_len); memcpy(plistener-bind, addr, addr-sa_len); -- Peter Malone pe...@petermalone.org

[patch l2tp_ctrl.c] malloc memset = calloc

2014-04-24 Thread Peter Malone
(l2tp_ctrl *)_this; } -- Peter Malone pe...@petermalone.org

[patch parse.c] malloc memset = calloc

2014-04-24 Thread Peter Malone
-end = d-data + d-size; s-kindset = kindset; -- Peter Malone pe...@petermalone.org

Re: [patch sbin/nfsd/nfsd.c] replace malloc memset with calloc

2014-04-24 Thread Peter Malone
Thanks Ted. I sent through another patch with timeout = -1. Passing INFTIM sounds like the best option though. Hopefully the rest checks out. On 04/24/14 20:30, Ted Unangst wrote: On Thu, Apr 24, 2014 at 19:27, Peter Malone wrote: The more I think about this. if we want to continue

[patch bin/cp/utils.c] replace malloc memset with calloc

2014-04-23 Thread Peter Malone
); + err(1, calloc); } if ((from_fd = open(entp-fts_path, O_RDONLY, 0)) == -1) { -- Peter Malone pe...@petermalone.org utils.patch Description: Binary data

[patch bin/systrace/intercept.c] replace malloc memset with calloc

2014-04-23 Thread Peter Malone
intercept_translate)); tlnew-off = offset; TAILQ_INSERT_TAIL(tmp-tls, tlnew, next); -- Peter Malone pe...@petermalone.org intercept.c Description: Binary data

[patch sbin/nfsd/nfsd.c] replace malloc memset with calloc

2014-04-23 Thread Peter Malone
) FD_SET(tcpsock, sockbits); -- Peter Malone pe...@petermalone.org

Re: [patch bin/systrace/intercept.c] replace malloc memset with calloc

2014-04-23 Thread Peter Malone
t...@tedunangst.com wrote: On Wed, Apr 23, 2014 at 21:24, Peter Malone wrote: Hi, Similar to previous patches replacing malloc memset with calloc, this time in src/bin/systrace/intercept.c - tlnew = malloc(sizeof(struct intercept_translate)); + tlnew = calloc(1, sizeof

Re: [patch sbin/nfsd/nfsd.c] replace malloc memset with calloc

2014-04-23 Thread Peter Malone
Sounds good. I'll work on that tomorrow afternoon/evening. On 04/23/14 21:55, Ted Unangst wrote: On Wed, Apr 23, 2014 at 21:38, Peter Malone wrote: Hi, Similar to the others. malloc memset replacement with calloc, this time in sbin/nfsd/nfsd.c fd_size = howmany(maxsock + 1, NFDBITS

sudo alloc.c -- cleanup required?

2014-04-23 Thread Peter Malone
estrdup(), but could be implemented better (it calls the malloc wrapper). Any thoughts on this? -- Peter Malone pe...@petermalone.org

[patch usr.sbin/snmpd/mib.c] replace malloc memset with calloc

2014-04-23 Thread Peter Malone
, sizeof(struct carpif)); memcpy(cif-carpr, carpr, sizeof(struct carpreq)); memcpy(cif-kif, kif, sizeof(struct kif)); } -- Peter Malone pe...@petermalone.org

[patch usr.sbin/rwhod/rwhod.c] replace malloc memset with calloc

2014-04-23 Thread Peter Malone
-n_addr = (struct sockaddr *)(np + 1); np-n_addrlen = dstaddr-sa_len; -- Peter Malone pe...@petermalone.org

[patch dso_lib.c] replace malloc memset with calloc

2014-04-21 Thread Peter Malone
Hi, Theo has been working on these patches over the past few days. I noticed an issue with dso_lib.c and fixed it accordingly. # cvs diff -u -r1.10 dso_lib.c Index: dso_lib.c === RCS file:

[patch ping.c] replace malloc memset with calloc

2014-04-21 Thread Peter Malone
Hi, malloc memset can be replaced with calloc in ping.c. Please see below for patch details: Index: ping.c === RCS file: /cvs/src/sbin/ping/ping.c,v retrieving revision 1.100 diff -u -p -u -r1.100 ping.c --- ping.c24 Mar

Re: [patch] courier-imap-4.13 imapd patch replacing malloc, strcat and strcpy with asprintf

2014-04-20 Thread Peter Malone
That's it in a nutshell, essentially. I'll take a stab at it, until I get frustrated. Perhaps my time would be better suited to something else which could help OpenBSD. For the time being, however, I'll give this a shot. On 04/20/14 02:18, Maxime Villard wrote: Le 20/04/2014 02:38, Peter

[patch] courier-imap-4.13 imapd patch replacing malloc, strcat and strcpy with asprintf

2014-04-19 Thread Peter Malone
Hi, I'm using OpenBSD 5.5. courier-imap-4.13 is in the ports tree and it's quite a mess. I started looking at it today with the hope of just replacing some of the malloc,strcat strcpy calls with asprintf, but it became clear before long that there's lots more issues with this code. Regardless,