Re: [PATCH] avoid malloc(0) in getdents

2009-10-07 Thread Dmitry V. Levin
On Wed, Oct 07, 2009 at 07:48:50PM -0400, Mike Frysinger wrote: > On Wednesday 07 October 2009 19:32:39 Dmitry V. Levin wrote: > > On Wed, Oct 07, 2009 at 05:25:01AM -0400, Mike Frysinger wrote: > > > When getdents finishes processing, it returns 0. Strace uses this to > > > then try and do malloc

Re: [PATCH] avoid malloc(0) in getdents

2009-10-07 Thread Mike Frysinger
On Wednesday 07 October 2009 19:32:39 Dmitry V. Levin wrote: > On Wed, Oct 07, 2009 at 05:25:01AM -0400, Mike Frysinger wrote: > > When getdents finishes processing, it returns 0. Strace uses this to > > then try and do malloc(0), but on some systems this will always return > > NULL. Since the cod

Re: [PATCH] avoid malloc(0) in getdents

2009-10-07 Thread Dmitry V. Levin
On Wed, Oct 07, 2009 at 05:25:01AM -0400, Mike Frysinger wrote: > When getdents finishes processing, it returns 0. Strace uses this to then > try and do malloc(0), but on some systems this will always return NULL. > Since the code won't read the pointer in question if len is 0, then don't > abort

[PATCH] avoid malloc(0) in getdents

2009-10-07 Thread Mike Frysinger
When getdents finishes processing, it returns 0. Strace uses this to then try and do malloc(0), but on some systems this will always return NULL. Since the code won't read the pointer in question if len is 0, then don't abort on the malloc(0) == NULL case. * file.c (sys_getdents, sys_getdents64):