Re: [Bacula-devel] crash in 5.2.2 - bug fix

2011-12-05 Thread James Harper
> > Hello, > > On 12/05/2011 10:08 AM, James Harper wrote: > >> Unfortunately, the previous code was : > >> /* TODO: see if len contains already the 3 \0 */ > >> item = (CurFile > > *)jcr->file_list->hash_malloc(sizeof(CurFile)+len+3); > >> > >> And the new code is > >> item = (Cur

Re: [Bacula-devel] crash in 5.2.2 - bug fix

2011-12-05 Thread Eric Bollengier
Hello, On 12/05/2011 10:08 AM, James Harper wrote: >> Unfortunately, the previous code was : >> /* TODO: see if len contains already the 3 \0 */ >> item = (CurFile > *)jcr->file_list->hash_malloc(sizeof(CurFile)+len+3); >> >> And the new code is >> item = (CurFile > *)jcr->file_list

Re: [Bacula-devel] crash in 5.2.2 - bug fix

2011-12-05 Thread Eric Bollengier
On 12/05/2011 10:03 AM, James Harper wrote: >> >> Thanks to pin this problem, I think that allocating 1 extra byte as we > did in the >> previous version will handle this problem. >> >> Unfortunately, the previous code was : >> /* TODO: see if len contains already the 3 \0 */ >> item = (C

Re: [Bacula-devel] crash in 5.2.2 - bug fix

2011-12-05 Thread James Harper
> Unfortunately, the previous code was : > /* TODO: see if len contains already the 3 \0 */ > item = (CurFile *)jcr->file_list->hash_malloc(sizeof(CurFile)+len+3); > > And the new code is > item = (CurFile *)jcr->file_list->hash_malloc(sizeof(CurFile)+len); > > This is a serious issue

Re: [Bacula-devel] crash in 5.2.2 - bug fix

2011-12-05 Thread James Harper
> > Thanks to pin this problem, I think that allocating 1 extra byte as we did in the > previous version will handle this problem. > > Unfortunately, the previous code was : > /* TODO: see if len contains already the 3 \0 */ > item = (CurFile *)jcr->file_list->hash_malloc(sizeof(CurFile)+

Re: [Bacula-devel] crash in 5.2.2 - bug fix

2011-12-05 Thread Eric Bollengier
Hello James, On 12/05/2011 06:47 AM, James Harper wrote: > The crash I describe below is caused by an off-by-one error in > accurate.c... > > In accurate_cmd, a blank chksum is not included in the length passed to > accurate_add_file, but in accurate_add_file, the blank chksum takes up > one byte