Re: malloc in libssl/src/apps

2014-05-04 Thread patrick keshishian
On Sun, May 04, 2014 at 02:38:40AM -0400, Jean-Philippe Ouellet wrote: Hello, I've gone through lib/libssl/src/apps with the goal of making {m,c,re}alloc uses more idiomatic, adding error checking in some places where missing, and some minor style unification. Feedback appreciated, better

Re: malloc in libssl/src/apps

2014-05-04 Thread Philip Guenther
On Sun, May 4, 2014 at 12:21 AM, patrick keshishian sids...@boxsoft.comwrote: On Sun, May 04, 2014 at 02:38:40AM -0400, Jean-Philippe Ouellet wrote: ... - if ((irow = (char **)malloc(sizeof(char *) * - (DB_NUMBER + 1))) == NULL) { + irow =

Re: malloc in libssl/src/apps

2014-05-04 Thread patrick keshishian
On Sun, May 04, 2014 at 12:29:59AM -0700, Philip Guenther wrote: On Sun, May 4, 2014 at 12:21 AM, patrick keshishian sids...@boxsoft.comwrote: On Sun, May 04, 2014 at 02:38:40AM -0400, Jean-Philippe Ouellet wrote: ... - if ((irow = (char **)malloc(sizeof(char *) * -

Re: malloc in libssl/src/apps

2014-05-04 Thread Marc Espie
On Sun, May 04, 2014 at 12:21:04AM -0700, patrick keshishian wrote: why not use calloc(2)? Because it doesn't exist ? (hint: the 2 in calloc(2) is the manual section. There is no calloc system call, therefore you can't be right. See guenther(2) for a more serious answer).

Re: malloc in libssl/src/apps

2014-05-04 Thread Philip Guenther
On Sunday, May 4, 2014, patrick keshishian sids...@boxsoft.com wrote: On Sun, May 04, 2014 at 12:29:59AM -0700, Philip Guenther wrote: On Sun, May 4, 2014 at 12:21 AM, patrick keshishian sids...@boxsoft.comjavascript:; wrote: On Sun, May 04, 2014 at 02:38:40AM -0400, Jean-Philippe

Re: malloc in libssl/src/apps

2014-05-04 Thread patrick keshishian
On Sun, May 04, 2014 at 01:26:18AM -0700, Philip Guenther wrote: On Sunday, May 4, 2014, patrick keshishian sids...@boxsoft.com wrote: On Sun, May 04, 2014 at 12:29:59AM -0700, Philip Guenther wrote: On Sun, May 4, 2014 at 12:21 AM, patrick keshishian sids...@boxsoft.comjavascript:;

sftp zap extra whitespace

2014-05-04 Thread Loganaden Velvindron
Hi All, An extra whitespace can be removed here: Index: sftp.c === RCS file: /cvs/src/usr.bin/ssh/sftp.c,v retrieving revision 1.162 diff -u -p -u -p -r1.162 sftp.c --- sftp.c 29 Apr 2014 20:36:51 - 1.162 +++ sftp.c

ssh regression suite connect-privsep.sh issue

2014-05-04 Thread Loganaden Velvindron
Hi All, The 'Z' flag was removed 10 days ago by Ted. connect-privsep.sh complains that there is an unknown malloc option. Diff below: Index: connect-privsep.sh === RCS file: /cvs/src/regress/usr.bin/ssh/connect-privsep.sh,v

Re: malloc in libssl/src/apps

2014-05-04 Thread patrick keshishian
On Sun, May 04, 2014 at 02:38:40AM -0400, Jean-Philippe Ouellet wrote: Hello, I've gone through lib/libssl/src/apps with the goal of making {m,c,re}alloc uses more idiomatic, adding error checking in some places where missing, and some minor style unification. Feedback appreciated, better

USB *hci(4) freelists

2014-05-04 Thread Martin Pieuchot
In USB land there is a lot of freelists. Every HC driver has one freelist per type of descriptor and the memory allocator used to populate these lists, usb_allocmem(), is a wrapper around bus_dma{mem,map}* that uses two more lists. I don't see the point of having per-softc lists, but maybe

HID parser

2014-05-04 Thread Martin Pieuchot
In December 2012 a user reported on misc@ that the Noppoo Mini Choc 84 USB keyboard does not work on OpenBSD [0]. More recently, mcbride@ and yasuoka@ contacted me because they have a mouse that is not properly recognized. Both issues are related to our HID descriptor parser. The diff below is

ums(4) memory leak

2014-05-04 Thread Martin Pieuchot
Plug a memory leak related to HID descriptor parsing, ok? Index: hidms.c === RCS file: /cvs/src/sys/dev/usb/hidms.c,v retrieving revision 1.5 diff -u -p -r1.5 hidms.c --- hidms.c 9 Aug 2013 22:10:17 - 1.5 +++ hidms.c

Re: malloc in libssl/src/apps

2014-05-04 Thread Jean-Philippe Ouellet
On Sun, May 04, 2014 at 12:17:16PM -0600, Theo de Raadt wrote: We are going to completely ignore diffs which change multiple idioms at once. Okay. That is how mistakes get made. Yep, more true than I realized. Here's a simpler one: Index: apps.c

Re: vfs references to strncpy and MFSNAMELEN

2014-05-04 Thread Héctor Luis Gimbatti
I did not get any reply except yours.- Indeed patching is very easy that's why I didn't bother to post one and let most advanced users to patch it.- Testing for regressions can be hard.- I've found, in 5.4 version, upto 1400 references to strncpy but most of them should cause no problem (nor

Re: malloc in libssl/src/apps

2014-05-04 Thread Alexander Hall
On 05/04/14 21:50, Jean-Philippe Ouellet wrote: On Sun, May 04, 2014 at 12:17:16PM -0600, Theo de Raadt wrote: We are going to completely ignore diffs which change multiple idioms at once. Okay. That is how mistakes get made. Yep, more true than I realized. Here's a simpler one: Index:

Re: malloc in libssl/src/apps

2014-05-04 Thread Andres Perera
On Sun, May 4, 2014 at 5:00 PM, Alexander Hall alexan...@beard.se wrote: On 05/04/14 21:50, Jean-Philippe Ouellet wrote: On Sun, May 04, 2014 at 12:17:16PM -0600, Theo de Raadt wrote: We are going to completely ignore diffs which change multiple idioms at once. Okay. That is how

Re: malloc in libssl/src/apps

2014-05-04 Thread Jean-Philippe Ouellet
On Sun, May 04, 2014 at 11:30:40PM +0200, Alexander Hall wrote: NULL theoretically could be != 0 Umm... short of something like: #undef NULL #define NULL I'm silly and want to break everything or something, I don't see when that'd be the case. According to ISO/IEC 9899:1999 TC3 (n1256)

Re: malloc in libssl/src/apps

2014-05-04 Thread Jean-Philippe Ouellet
On Mon, May 05, 2014 at 11:12:00AM +1000, Joel Sing wrote: - i = 0; if (arg-count == 0) { arg-count = 20; - arg-data = (char **)malloc(sizeof(char *) * arg-count); + arg-data = calloc(arg-count, sizeof(char *)); } - for (i = 0; i

Re: malloc in libssl/src/apps

2014-05-04 Thread patrick keshishian
On Sun, May 04, 2014 at 03:50:06PM -0400, Jean-Philippe Ouellet wrote: On Sun, May 04, 2014 at 12:17:16PM -0600, Theo de Raadt wrote: We are going to completely ignore diffs which change multiple idioms at once. Okay. That is how mistakes get made. Yep, more true than I realized.